copyWith method

PlacesResponse copyWith({
  1. List<Place>? places,
  2. List<RoutingSummary>? routingSummaries,
  3. List<ContextualContent>? contextualContents,
  4. String? nextPageToken,
  5. String? searchUri,
})

Implementation

PlacesResponse copyWith({
  List<Place>? places,
  List<RoutingSummary>? routingSummaries,
  List<ContextualContent>? contextualContents,
  String? nextPageToken,
  String? searchUri,
}) {
  return PlacesResponse(
    places: ((places?.isNotEmpty ?? false) ? places : null) ?? this.places,
    routingSummaries:
        ((routingSummaries?.isNotEmpty ?? false) ? routingSummaries : null) ??
        this.routingSummaries,
    contextualContents:
        ((contextualContents?.isNotEmpty ?? false)
            ? contextualContents
            : null) ??
        this.contextualContents,
    nextPageToken: nextPageToken ?? this.nextPageToken,
    searchUri: searchUri ?? this.searchUri,
  );
}