ConnectedBluetoothDeviceInfo.fromMap constructor
ConnectedBluetoothDeviceInfo.fromMap(
- Map<String, dynamic> map
)
Implementation
factory ConnectedBluetoothDeviceInfo.fromMap(Map<String, dynamic> map) {
return ConnectedBluetoothDeviceInfo(
name: map['name'] as String?,
macAddress: map['macAddress'] as String? ?? '',
bondState: map['bondState'] as String? ?? 'none',
type: map['type'] as String? ?? 'unknown',
alias: map['alias'] as String?,
bluetoothClass: map['bluetoothClass'] as int?,
sourceProfiles: (map['sourceProfiles'] as List<dynamic>? ?? const [])
.map((value) => value.toString())
.toList(),
);
}