copyWith method

Road copyWith({
  1. double? distance,
  2. double? duration,
  3. List<RoadInstruction>? instructions,
  4. String? polylineEncoded,
  5. List<Road>? alternativesRoads,
})

Implementation

Road copyWith({
  double? distance,
  double? duration,
  List<RoadInstruction>? instructions,
  String? polylineEncoded,
  List<Road>? alternativesRoads,
}) {
  return Road(
    distance: distance ?? this.distance,
    duration: duration ?? this.duration,
    polylineEncoded: polylineEncoded ?? this.polylineEncoded,
  ).._alternativesRoads = alternativesRoads;
}