copyWith method

Landmark copyWith({
  1. String? name,
  2. String? placeId,
  3. LocalizedText? displayName,
  4. List<PlaceType>? types,
  5. SpatialRelationship? spatialRelationship,
  6. double? straightLineDistanceMeters,
  7. double? travelDistanceMeters,
})

Implementation

Landmark copyWith({
  String? name,
  String? placeId,
  LocalizedText? displayName,
  List<PlaceType>? types,
  SpatialRelationship? spatialRelationship,
  double? straightLineDistanceMeters,
  double? travelDistanceMeters,
}) {
  return Landmark(
    name: name ?? this.name,
    placeId: placeId ?? this.placeId,
    displayName: displayName ?? this.displayName,
    types: ((types?.isNotEmpty ?? false) ? types : null) ?? this.types,
    spatialRelationship: spatialRelationship ?? this.spatialRelationship,
    straightLineDistanceMeters:
        straightLineDistanceMeters ?? this.straightLineDistanceMeters,
    travelDistanceMeters: travelDistanceMeters ?? this.travelDistanceMeters,
  );
}