Battery class

API for accessing information about the battery of the device the Flutter app is running on.

Constructors

Battery()
Constructs a singleton instance of Battery.
factory

Properties

batteryLevel → Future<int>
Get battery level
no setter
batteryState → Future<BatteryState>
Get battery state
no setter
hashCode → int
The hash code for this object.
no setterinherited
isInBatterySaveMode → Future<bool>
Check if device is on battery save mode
no setter
onBatteryStateChanged → Stream<BatteryState>
Fires whenever the battery state changes.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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