BatteryThresholds class

Battery level thresholds for optimization.

Constructors

BatteryThresholds({int lowThreshold = 20, int criticalThreshold = 10})
Creates battery thresholds.
const
BatteryThresholds.fromMap(JsonMap map)
Creates from a map.
factory

Properties

criticalThreshold int
Battery percentage below which is considered critical.
final
hashCode int
The hash code for this object.
no setterinherited
lowThreshold int
Battery percentage below which is considered low.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getLevel(int percent) BatteryLevel
Gets the battery level category.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() JsonMap
Converts to a JSON-serializable map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

balanced → const BatteryThresholds
Balanced thresholds.
conservative → const BatteryThresholds
Conservative thresholds - start saving earlier.