onBatteryStateChanged property
Fires whenever the battery state changes.
Implementation
@override
Stream<BatteryState> get onBatteryStateChanged {
_onBatteryStateChanged ??= eventChannel
.receiveBroadcastStream()
.map((dynamic event) => parseBatteryState(event));
return _onBatteryStateChanged!;
}