calculateAdaptiveSettings static method
Calculates optimal settings based on current conditions.
Uses the adaptive tracking configuration to determine the best settings for current speed, battery level, and motion state.
Implementation
static Future<AdaptiveSettings> calculateAdaptiveSettings() async {
final config = _adaptiveConfig ?? AdaptiveTrackingConfig.balanced;
final state = await getState();
final power = await getPowerState();
final location = state.location;
final isInGeofence = await isInActiveGeofence();
return config.calculateSettings(
speedMps: location?.coords.speed ?? 0,
batteryPercent: power.batteryLevel,
isCharging: power.isCharging,
isMoving: state.isMoving,
activity: location?.activity?.type,
isInGeofence: isInGeofence,
);
}