disconnect method
Implementation
@override
Future disconnect({Duration? timeout}) async {
if (Platform.isWindows) {
_closeWindowsPrinter();
} else if (Platform.isAndroid) {
if (_androidConnected) {
_androidConnected = false;
try {
await usbPrinter.close();
} catch (_) {
// Already closed / detached: nothing to clean up.
}
}
}
if (timeout != null) {
await Future.delayed(timeout);
}
return true;
}