battery_insights 0.1.1
battery_insights: ^0.1.1 copied to clipboard
Measure real battery drain of your Flutter app on Android — per flow (checkout, camera, calls) and for every user across foreground and background — with no drain of its own.
0.1.1 #
- Battery health. New
BatteryInsights.instance.batteryHealthgetter returning aBatteryHealth: full-charge capacity worked out from the phone's own readings, design capacity,healthPct,isWorn(), cycle count and Android's health status. - Example app: battery health card.
0.1.0 #
First public release.
- Flow-wise tracking.
startFlow()/BatteryFlowRun.finish()return the battery cost of each flow visit;BatteryFlowScopeandBatteryFlowRouteObserverattribute flows by widget or by route. Onebattery_flowevent per visit. - Every-user tracking. Foreground and background sessions (
battery_session), and segments of constant state (battery_segment) that split drain by flow, app state, charging, screen, power saver, brightness, network and up tomaxDimensionsof your own. - On-device usage.
BatteryInsights.instance.usagekeeps daily totals by app state and flow — no backend needed.usageDayssets how many days (default 14, up to 366;0turns it off and deletes stored totals), so apps can let users choose. - Device facts. Full-charge capacity (stable median estimate), design capacity, cycle count and health, sent once through
deviceSink. - No drain of its own. No timers, wake locks, alarms or battery receivers; reads only when the app is already awake.
- Debug tools.
BatteryInsightsDebugViewand a floatingBatteryInsightsOverlayHUD. - Android only (API 21+). Other platforms are safe no-ops.