connectToGenericPrinter method
Implementation
Future<void> connectToGenericPrinter(String address) async {
if (controller.selectedAddress != null) {
await disconnect();
await Future.delayed(Durations.medium1);
}
if (controller.selectedAddress == address) {
await disconnect();
controller.selectedAddress = null;
return;
}
controller.selectedAddress = address;
channel.invokeMethod("connectToGenericPrinter", {"Address": address});
}