BatteryThresholds.fromMap constructor

BatteryThresholds.fromMap(
  1. JsonMap map
)

Creates from a map.

Implementation

factory BatteryThresholds.fromMap(JsonMap map) {
  return BatteryThresholds(
    lowThreshold: (map['lowThreshold'] as num?)?.toInt() ?? 20,
    criticalThreshold: (map['criticalThreshold'] as num?)?.toInt() ?? 10,
  );
}