onBatteryStateChanged method
Event channel for getting battery change state.
Implementation
Stream<BatteryState> onBatteryStateChanged() {
if (_onBatteryStateChanged == null) {
_onBatteryStateChanged = eventChannel
.receiveBroadcastStream()
.map((dynamic event) => _parseBatteryState(event));
}
return _onBatteryStateChanged!;
}