unpairPrinter method

Future<bool> unpairPrinter(
  1. String address
)

Unpairs a Bluetooth device Uses Android Bluetooth API to remove bonding

Returns true if successful, throws exception otherwise

Implementation

Future<bool> unpairPrinter(String address) async {
  try {
    print('[PrinterManager] unpairPrinter called for: $address');
    final result = await _channel.invokeMethod('unpairPrinter', {'address': address});
    print('[PrinterManager] unpairPrinter successful');
    return result as bool;
  } on PlatformException catch (e) {
    print('[PrinterManager] unpairPrinter error: ${e.code} - ${e.message}');
    throw Exception("Unpair Printer Error (${e.code}): ${e.message}");
  }
}