getDevices method

  1. @override
Future<List<BluetoothDevice>> getDevices(
  1. List<String> deviceIds
)
override

实现 FlutterBluetoothPluginPlatform.getDevices

Web 只能按 ID 返回当前站点已授权或本次页面已选择过的设备。

Implementation

@override
Future<List<BluetoothDevice>> getDevices(List<String> deviceIds) async {
  await _authorizedDevices();
  return deviceIds
      .map((deviceId) => _knownDevices[deviceId])
      .whereType<_WebBluetoothDevice>()
      .map(_deviceFromWeb)
      .toList(growable: false);
}