isConnected method Null safety
- PrinterDevice device
判断打印机是否已连接
device
打印机设备
Implementation
Future<bool> isConnected(PrinterDevice device) async {
var connectedDevices = await getConnectedPrinters(type: device.type);
var first =
connectedDevices?.firstWhere((e) => e.identify() == device.identify());
return first != null;
}