synchronizePrinter method

void synchronizePrinter(
  1. String connectedString
)

Implementation

void synchronizePrinter(String connectedString) {
  if (selectedAddress == null) return;
  final int index =
      _printers.indexWhere((element) => element.address == selectedAddress);
  if (index == -1) {
    selectedAddress = null;
    return;
  }
  if (_printers[index].isConnected) return;
  _printers[index] = _printers[index].copyWith(
      status: connectedString, color: Colors.green, isConnected: true);
  notifyListeners();
}