copyWith method

PlacePrediction copyWith({
  1. String? place,
  2. String? placeId,
  3. FormattableText? text,
  4. StructuredFormat? structuredFormat,
  5. List<PlaceType>? types,
  6. int? distanceMeters,
})

Implementation

PlacePrediction copyWith({
  String? place,
  String? placeId,
  FormattableText? text,
  StructuredFormat? structuredFormat,
  List<PlaceType>? types,
  int? distanceMeters,
}) {
  return PlacePrediction(
    place: place ?? this.place,
    placeId: placeId ?? this.placeId,
    text: text ?? this.text,
    structuredFormat: structuredFormat ?? this.structuredFormat,
    types: ((types?.isNotEmpty ?? false) ? types : null) ?? this.types,
    distanceMeters: distanceMeters ?? this.distanceMeters,
  );
}