disconnect method

Future<bool> disconnect({
  1. required PrinterType type,
  2. int? delayMs,
})

Implementation

Future<bool> disconnect({required PrinterType type, int? delayMs}) async {
  if (type == PrinterType.bluetooth && (Platform.isIOS || Platform.isAndroid)) {
    return await bluetoothPrinterConnector.disconnect();
  } else if (type == PrinterType.usb && (Platform.isAndroid || Platform.isWindows)) {
    return await usbPrinterConnector.disconnect(delayMs: delayMs);
  } else {
    return await tcpPrinterConnector.disconnect();
  }
}