connectToBluetoothPrinter method

  1. @override
Future<bool?> connectToBluetoothPrinter(
  1. String? printer
)
override

connectToBluetoothPrinter(String) attempts to connect to a printer via Bluetooth Low Energy whose name is passed into the method. This is asynchronous and returns a Boolean value afterwards with the result of the connection (i.e. success or failure).

Implementation

@override
Future<bool?> connectToBluetoothPrinter(String? printer) async {
  var sendMap = <String, dynamic>{"printerName": printer};
  bool? connected = await methodChannel.invokeMethod<bool>(
      'connectToBluetoothPrinter', sendMap);
  return connected;
}