BatteryState.fromMap constructor
Creates a BatteryState from a map, typically received from platform code.
The map
must contain 'level', 'temperature', and 'isCharging' keys.
Implementation
factory BatteryState.fromMap(Map<String, dynamic> map) {
return BatteryState(
level: map['level'],
temperature: map['temperature'],
isCharging: map['isCharging'],
);
}