Battery class

Device battery information.

BackgroundGeolocation.onLocation((Location location) {
  bool isCharging = location.battery.isCharging;
  double level    = location.battery.level;

  print("[onLocation] Battery state, isCharging: $isCharging, level: $level");
});

Constructors

Battery(dynamic battery)

Properties

hashCode int
The hash code for this object.
no setterinherited
isCharging bool
true when device is plugged in to power.
getter/setter pair
level double
Battery level. 0.0 = empty; 1.0 = full charge.
getter/setter pair
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