battery 0.3.0+5 copy "battery: ^0.3.0+5" to clipboard
battery: ^0.3.0+5 copied to clipboard

discontinued
outdated

Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS.

Battery #

pub package

A Flutter plugin to access various information about the battery of the device the app is running on.

Usage #

To use this plugin, add battery as a dependency in your pubspec.yaml file.

Example #

// Import package
import 'package:battery/battery.dart';

// Instantiate it
var battery = Battery();

// Access current battery level
print(await battery.batteryLevel);

// Be informed when the state (full, charging, discharging) changes
_battery.onBatteryStateChanged.listen((BatteryState state) {
  // Do something with new state
});
270
likes
0
pub points
98%
popularity

Publisher

verified publisherflutter.dev

Flutter plugin for accessing information about the battery state (full, charging, discharging) on Android and iOS.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on battery