copyWith method

RALINavigationState copyWith({
  1. RALINavigationMode? mode,
  2. NavigationStatus? status,
  3. Point? currentLocation,
  4. Point? destination,
  5. double? progress,
  6. List<NavigationStep>? navigationSteps,
  7. DateTime? navigationStartTime,
  8. Duration? estimatedTimeRemaining,
})

Creates a copy of the current state with optional updates

Implementation

RALINavigationState copyWith({
  RALINavigationMode? mode,
  NavigationStatus? status,
  mapbox.Point? currentLocation,
  mapbox.Point? destination,
  double? progress,
  List<NavigationStep>? navigationSteps,
  DateTime? navigationStartTime,
  Duration? estimatedTimeRemaining,
}) {
  return RALINavigationState(
    mode: mode ?? this.mode,
    status: status ?? this.status,
    currentLocation: currentLocation ?? this.currentLocation,
    destination: destination ?? this.destination,
    progress: progress != null ? _sanitizeProgress(progress) : this.progress,
    navigationSteps: navigationSteps ?? this.navigationSteps,
    navigationStartTime: navigationStartTime ?? this.navigationStartTime,
    estimatedTimeRemaining: estimatedTimeRemaining ?? this.estimatedTimeRemaining,
  );
}