androidBatteryInfoStream property

Stream<AndroidBatteryInfo?> get androidBatteryInfoStream

Returns a stream of BatteryInfo data that is pushed out to the subscribers on updates

Implementation

Stream<AndroidBatteryInfo?> get androidBatteryInfoStream {
  return streamChannel.receiveBroadcastStream().map((data) {
    try {
      final converted = AndroidBatteryInfo.fromJson(Map.from(data));
      return converted;
    } on PlatformException catch (e) {
      print(e.message);
      return null;
    }
  });
}