estimateBatteryRunway static method

Future<BatteryRunway> estimateBatteryRunway()

Estimates remaining battery runway for tracking.

Returns predictions for how long tracking can continue at current and low power rates, along with recommendations.

Implementation

static Future<BatteryRunway> estimateBatteryRunway() async {
  final stats = await getBatteryStats();
  final powerState = await getPowerState();

  return BatteryRunwayCalculator.calculate(
    currentLevel: stats.currentBatteryLevel ?? powerState.batteryLevel,
    isCharging: stats.isCharging ?? powerState.isCharging,
    drainPercent: stats.estimatedDrainPercent,
    trackingMinutes: stats.trackingDurationMinutes,
  );
}