BatteryDatum class
A Datum that holds battery level collected from the phone.
Constructors
- BatteryDatum.new([int? batteryLevel, String? batteryStatus])
- BatteryDatum.fromBatteryState(int level, BatteryState state)
-
BatteryDatum.fromJson(Map<
String, dynamic> json) -
factory
Properties
- batteryLevel ↔ int?
-
The battery level in percent.
getter/setter pair
- batteryStatus ↔ String?
-
The charging status of the battery:
getter/setter pair
- format ↔ DataFormat
-
The
DataFormat
of this type of Datum.getter/setter pairinherited-setteroverride-getter - hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
An identifier for this Datum, unique across all data generated.
If this datum is part of a MultiDatum, then this id is null.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timestamp ↔ DateTime
-
The UTC timestamp when this data was generated on the device.
getter/setter pairinherited
Methods
-
equivalentTo(
ConditionalEvent? event) → bool -
Returns
true
if the batteryLevel is equal.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Return a JSON encoding of this datum.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- STATE_CHARGING → const String
- STATE_DISCHARGING → const String
- STATE_FULL → const String
- STATE_UNKNOWN → const String