connectToPrinter method

Future<void> connectToPrinter(
  1. String address
)

Implementation

Future<void> connectToPrinter(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("connectToPrinter", {"Address": address});
}