PowerState class

Native Android battery and power state reported by the device.

Constructors

PowerState({required int batteryLevel, required bool isCharging, required String chargingSource, required String batteryHealth, required String batteryStatus, required double batteryTemperatureCelsius, required bool isPowerSaveMode, required bool isIgnoringBatteryOptimizations})
Creates a power state description.
const
PowerState.fromMap(Map<Object?, Object?> map)
Creates a PowerState from a map returned by the native platform.
factory

Properties

batteryHealth String
The readable battery health reported by Android.
final
batteryLevel int
The battery level percentage from 0 to 100, or 0 when unavailable.
final
batteryStatus String
The readable battery status reported by Android.
final
batteryTemperatureCelsius double
The battery temperature in degrees Celsius.
final
chargingSource String
The readable charging source, such as AC, USB, Wireless, or Not charging.
final
hashCode int
The hash code for this object.
no setterinherited
isCharging bool
Whether Android reports that the battery is charging or full.
final
isIgnoringBatteryOptimizations bool
Whether this app is ignoring Android battery optimizations.
final
isPowerSaveMode bool
Whether Android power saver mode is currently enabled.
final
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
toMap() Map<String, Object>
Converts this power state to a map using the native field names.
toString() String
Returns a readable string containing all power fields.
override

Operators

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