BatteryPlatform class abstract
The interface that implementations of battery must implement.
Platform implementations should extend this class rather than implement it as battery
does not consider newly added methods to be breaking changes. Extending this class
(using extends
) ensures that the subclass will get the default implementation, while
platform implementations that implements
this interface will be broken by newly added
BatteryPlatform methods.
- Inheritance
-
- Object
- PlatformInterface
- BatteryPlatform
- Implementers
Constructors
- BatteryPlatform()
- Constructs a BatteryPlatform.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
batteryLevel(
) → Future< int> - Gets the battery level from device.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onBatteryStateChanged(
) → Stream< BatteryState> - gets battery state from device.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ BatteryPlatform
-
The default instance of BatteryPlatform to use.
getter/setter pair