BluetoothConnectionStateEvent.fromMap constructor
从原生 Map 创建连接状态事件。
参数:
map:原生事件数据,无默认值。
Implementation
factory BluetoothConnectionStateEvent.fromMap(Map<String, dynamic> map) {
return BluetoothConnectionStateEvent(
deviceId: map['deviceId']?.toString() ?? '',
state: bluetoothConnectionStateFromString(map['state']?.toString()),
status: (map['status'] as num?)?.toInt(),
);
}