send method

Future<bool> send({
  1. required PrinterType type,
  2. required List<int> bytes,
})

Implementation

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