isConnected method
Implementation
Future<bool> isConnected(Printer device) async {
if (device.connectionType == ConnectionType.USB) {
return await FlutterThermalPrinterPlatform.instance.isConnected(device);
} else {
try {
final bt = BluetoothDevice.fromId(device.address!);
return bt.isConnected;
} catch (e) {
return false;
}
}
}