copyWith method
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;
}