BluetoothState.fromMap constructor

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

Implementation

factory BluetoothState.fromMap(Map<String, dynamic> map) {
  final devices = (map['connectedDevices'] as List<dynamic>? ?? []).map((e) => BluetoothDevice.fromMap(Map<String, dynamic>.from(e))).toList();
  return BluetoothState(isBluetoothEnabled: map['isBluetoothEnabled'] ?? false, connectedDevices: devices);
}