discovery method

Stream<PrinterDevice> discovery({
  1. required PrinterType type,
  2. bool isBle = false,
  3. TcpPrinterInput? model,
})

Implementation

Stream<PrinterDevice> discovery(
    {required PrinterType type, bool isBle = false, TcpPrinterInput? model}) {
  if (type == PrinterType.bluetooth &&
      (Platform.isIOS || Platform.isAndroid)) {
    return bluetoothPrinterConnector.discovery(isBle: isBle);
  } else if (type == PrinterType.usb &&
      (Platform.isAndroid || Platform.isWindows)) {
    return usbPrinterConnector.discovery();
  } else {
    return tcpPrinterConnector.discovery(model: model);
  }
}