getPairedDevices method

Future<List<BluetoothDevice>> getPairedDevices()

Get paired devices

Implementation

Future<List<BluetoothDevice>> getPairedDevices() async {
  try {
    final List<dynamic> devices =
        await _channel.invokeMethod('getPairedDevices');
    return devices.map((device) => BluetoothDevice.fromMap(device)).toList();
  } catch (e) {
    throw BluetoothException('Failed to get paired devices: $e');
  }
}