copyWith method

TripConfig copyWith({
  1. String? tripId,
  2. bool? startOnMoving,
  3. double? startDistanceMeters,
  4. double? startSpeedKph,
  5. bool? stopOnStationary,
  6. int? stopTimeoutMinutes,
  7. double? stationarySpeedKph,
  8. int? updateIntervalSeconds,
  9. int? dwellMinutes,
  10. List<RoutePoint>? route,
  11. double? routeDeviationThresholdMeters,
  12. int? routeDeviationCooldownSeconds,
  13. RoutePoint? destination,
  14. List<RoutePoint>? waypoints,
})

Creates a copy with modified values.

Implementation

TripConfig copyWith({
  String? tripId,
  bool? startOnMoving,
  double? startDistanceMeters,
  double? startSpeedKph,
  bool? stopOnStationary,
  int? stopTimeoutMinutes,
  double? stationarySpeedKph,
  int? updateIntervalSeconds,
  int? dwellMinutes,
  List<RoutePoint>? route,
  double? routeDeviationThresholdMeters,
  int? routeDeviationCooldownSeconds,
  RoutePoint? destination,
  List<RoutePoint>? waypoints,
}) {
  return TripConfig(
    tripId: tripId ?? this.tripId,
    startOnMoving: startOnMoving ?? this.startOnMoving,
    startDistanceMeters: startDistanceMeters ?? this.startDistanceMeters,
    startSpeedKph: startSpeedKph ?? this.startSpeedKph,
    stopOnStationary: stopOnStationary ?? this.stopOnStationary,
    stopTimeoutMinutes: stopTimeoutMinutes ?? this.stopTimeoutMinutes,
    stationarySpeedKph: stationarySpeedKph ?? this.stationarySpeedKph,
    updateIntervalSeconds:
        updateIntervalSeconds ?? this.updateIntervalSeconds,
    dwellMinutes: dwellMinutes ?? this.dwellMinutes,
    route: route ?? this.route,
    routeDeviationThresholdMeters:
        routeDeviationThresholdMeters ?? this.routeDeviationThresholdMeters,
    routeDeviationCooldownSeconds:
        routeDeviationCooldownSeconds ?? this.routeDeviationCooldownSeconds,
    destination: destination ?? this.destination,
    waypoints: waypoints ?? this.waypoints,
  );
}