copyWith method

RouteDetails copyWith({
  1. List<RaliPosition>? points,
  2. double? distance,
  3. double? duration,
  4. List<NavigationStep>? steps,
  5. BoundingBox? bounds,
  6. RouteEmphasis? emphasis,
  7. Map<String, dynamic>? trafficAnnotations,
  8. Map<String, double>? speedLimits,
  9. List<Hazard>? hazards,
  10. Map<String, List<Landmark>>? landmarks,
  11. List<WeatherAlert>? weatherAlerts,
})

Creates a copy of this route with modified properties

Implementation

RouteDetails copyWith({
  List<RaliPosition>? points,
  double? distance,
  double? duration,
  List<NavigationStep>? steps,
  BoundingBox? bounds,
  RouteEmphasis? emphasis,
  Map<String, dynamic>? trafficAnnotations,
  Map<String, double>? speedLimits,
  List<Hazard>? hazards,
  Map<String, List<Landmark>>? landmarks,
  List<WeatherAlert>? weatherAlerts,
}) {
  return RouteDetails(
    points: points ?? this.points,
    distance: distance ?? this.distance,
    duration: duration ?? this.duration,
    steps: steps ?? this.steps,
    bounds: bounds ?? this.bounds,
    emphasis: emphasis ?? this.emphasis,
    trafficAnnotations: trafficAnnotations ?? this.trafficAnnotations,
    speedLimits: speedLimits ?? this.speedLimits,
    hazards: hazards ?? this.hazards,
    landmarks: landmarks ?? this.landmarks,
    weatherAlerts: weatherAlerts ?? this.weatherAlerts,
  );
}