BleDevice.fromMap constructor
BleDevice.fromMap(
- Map map
Converts a Map to a BleDevice object.
The map
, which contains information about the discovered Bluetooth device, comes from the plugin's method
channel. Therefore, the type annotation is <dynamic, dynamic>.
Implementation
factory BleDevice.fromMap(Map<dynamic, dynamic> map) {
return BleDevice(
name: map['name'] as String?,
address: map['address'] as String,
rssi: map['rssi'] as int,
manufacturerData:
map['manufacturerData'] == null ? null : ManufacturerData.fromString(map['manufacturerData'] as String),
);
}