BluetoothAdvertisingStateEvent.fromMap constructor

BluetoothAdvertisingStateEvent.fromMap(
  1. Map<String, dynamic> map
)

从原生 Map 创建广播状态事件。

参数:

  • map:原生事件数据,无默认值。

Implementation

factory BluetoothAdvertisingStateEvent.fromMap(Map<String, dynamic> map) {
  return BluetoothAdvertisingStateEvent(
    isAdvertising: _asBool(map['isAdvertising']),
    errorCode: (map['errorCode'] as num?)?.toInt(),
    message: map['message']?.toString(),
  );
}