copyWith method

Location copyWith({
  1. LocationCoordinates? coordinates,
  2. Optional<LocationFuzzyDouble?>? altitude,
  3. Optional<LocationCourse?>? course,
  4. Optional<LocationFuzzyDouble?>? groundSpeed,
  5. Duration? timestamp,
})

Implementation

Location copyWith({
  LocationCoordinates? coordinates,
  Optional<LocationFuzzyDouble?>? altitude,
  Optional<LocationCourse?>? course,
  Optional<LocationFuzzyDouble?>? groundSpeed,
  Duration? timestamp
}) {
  return Location(
    coordinates: coordinates ?? this.coordinates,
    altitude: altitude != null ? altitude.value : this.altitude,
    course: course != null ? course.value : this.course,
    groundSpeed: groundSpeed != null ? groundSpeed.value : this.groundSpeed,
    timestamp: timestamp ?? this.timestamp
  );
}