getBluetoothDevices method

  1. @override
Future<List<BluetoothPrinterDevice>> getBluetoothDevices()
override

Get list of paired Bluetooth devices

Implementation

@override
Future<List<BluetoothPrinterDevice>> getBluetoothDevices() async {
  final List<dynamic> result = await methodChannel.invokeMethod(
    'getBluetoothDevices',
  );
  return result
      .map(
        (device) => BluetoothPrinterDevice(
          name: device['name'],
          address: device['address'],
        ),
      )
      .toList();
}