copyWith method

RoadInfo copyWith({
  1. String? roadKey,
  2. double? distance,
  3. double? duration,
  4. List<Instruction>? instructions = const [],
  5. List<GeoPoint>? route = const [],
})

Implementation

RoadInfo copyWith({
  String? roadKey,
  double? distance,
  double? duration,
  List<Instruction>? instructions = const [],
  List<GeoPoint>? route = const [],
}) {
  return RoadInfo(
    distance: distance ?? this.distance,
    duration: duration ?? this.duration,
    route: route ?? this.route,
    instructions: instructions ?? this.instructions,
  )..setKey(roadKey ?? this._key);
}