BluetoothPhyEvent.fromMap constructor
从原生 Map 创建 PHY 事件。
参数:
map:原生事件数据,无默认值。
Implementation
factory BluetoothPhyEvent.fromMap(Map<String, dynamic> map) {
return BluetoothPhyEvent(
deviceId: map['deviceId']?.toString() ?? '',
txPhy: bluetoothPhyFromString(map['txPhy']?.toString()),
rxPhy: bluetoothPhyFromString(map['rxPhy']?.toString()),
status: (map['status'] as num?)?.toInt(),
);
}