battery_plus_watchos 0.1.0 copy "battery_plus_watchos: ^0.1.0" to clipboard
battery_plus_watchos: ^0.1.0 copied to clipboard

watchOS implementation of the battery_plus plugin, reporting battery level, charging state, and low-power mode from WKInterfaceDevice via dart:ffi.

battery_plus_watchos #

The watchOS implementation of battery_plus.

Scaffolded with flutter-watchos plugin port and finished by hand as an FFI implementation over WKInterfaceDevice — see PORTING_REPORT.md.

Usage #

dependencies:
  battery_plus: ^6.0.0
  battery_plus_watchos: ^0.1.0
final battery = Battery();
print(await battery.batteryLevel);       // 0–100
print(await battery.batteryState);       // charging / full / discharging

API coverage #

Member watchOS
batteryLevel WKInterfaceDevice.batteryLevel (monitoring auto-enabled)
batteryState WKInterfaceDevice.batteryState
isInBatterySaveMode NSProcessInfo.isLowPowerModeEnabled (watchOS 9+, else false)
onBatteryStateChanged ✅ poll-based — watchOS has no battery-change notification, so the stream polls every BatteryPlusWatchos.pollInterval (default 2s) and emits on change

License #

The FlutterWatch Authors under a BSD-3-Clause license. See LICENSE for the full text.

0
likes
140
points
103
downloads

Documentation

API reference

Publisher

verified publisherflutterwatch.dev

Weekly Downloads

watchOS implementation of the battery_plus plugin, reporting battery level, charging state, and low-power mode from WKInterfaceDevice via dart:ffi.

Homepage
Repository (GitHub)
View/report issues

Topics

#watchos #ffi #battery

License

BSD-3-Clause (license)

Dependencies

battery_plus_platform_interface, flutter

More

Packages that depend on battery_plus_watchos

Packages that implement battery_plus_watchos