disconnect method

  1. @override
Future<bool?> disconnect()
override

disconnect() asynchronously disconnects from the currently connected printer and returns a Boolean value afterwards with the result of the disconnect operation (i.e. success or failure).

This will also clear the value of "LastConnectedPrinterName" internally.

Implementation

@override
Future<bool?> disconnect() async {
  bool? disconnected = await methodChannel.invokeMethod<bool>('disconnect');
  return disconnected;
}