battery_plus 1.0.0-nullsafety.0 copy "battery_plus: ^1.0.0-nullsafety.0" to clipboard
battery_plus: ^1.0.0-nullsafety.0 copied to clipboard

outdated

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

Battery Plus #

Flutter Community: battery_plus

pub package

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

Platform Support #

Android iOS MacOS Web Linux Window
✔️ ✔️ ✔️ ✔️ ✔️ ✔️

Usage #

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

Example #

// Import package
import 'package:battery_plus/battery_plus.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
});
480
likes
0
points
89.2k
downloads

Publisher

verified publisherfluttercommunity.dev

Weekly Downloads

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

battery_plus_linux, battery_plus_macos, battery_plus_platform_interface, battery_plus_web, battery_plus_windows, flutter, meta

More

Packages that depend on battery_plus