getDevice method

  1. @override
Future<BluetoothDevice?> getDevice(
  1. String deviceId
)
override

实现 FlutterBluetoothPluginPlatform.getDevice

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

Implementation

@override
Future<BluetoothDevice?> getDevice(String deviceId) async {
  await _authorizedDevices();
  final device = _knownDevices[deviceId];
  return device == null ? null : _deviceFromWeb(device);
}