disconnectPrinter method

Future<bool?> disconnectPrinter()

Closes the active printer connection.

Returns true on success. Throws a descriptive string on failure.

Implementation

Future<bool?> disconnectPrinter() async {
  try {
    final bool? result = await _channel.invokeMethod('disconnectPrinter');
    return result;
  } on PlatformException catch (e) {
    throw 'Failed to disconnect printer: ${e.message}';
  }
}