planRoute method

Future<void> planRoute(
  1. RouteDetails route
)

Plans a route to the set destination

Implementation

Future<void> planRoute(RouteDetails route) async {
  try {
    _currentRoute = route;
    _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 planning route: $e');
    throw Exception('Failed to plan route: $e');
  }
}