setRouteOptions method
- RouteDetails primaryRoute,
- List<
RouteDetails> alternatives
Sets route options including alternatives
Implementation
void setRouteOptions(RouteDetails primaryRoute, List<RouteDetails> alternatives) async {
try {
_currentRoute = primaryRoute;
_alternativeRoutes = alternatives;
_selectedRouteIndex = 0;
_state = NavigationStatus.routePlanned;
_currentStepIndex = 0;
_progress = 0.0;
// Calculate cumulative distances for step tracking
_calculateCumulativeStepDistances();
// Save route state for persistence
await _saveNavigationState();
notifyListeners();
} catch (e) {
print('Error setting route options: $e');
throw Exception('Failed to set route options: $e');
}
}