copyWith method

SearchResult copyWith({
  1. String? query,
  2. List<SearchItem>? items,
  3. int? totalCount,
  4. int? executionTimeMs,
  5. bool? hasMore,
  6. String? nextPage,
})

Creates a copy of this result with updated fields.

Implementation

SearchResult copyWith({
  String? query,
  List<SearchItem>? items,
  int? totalCount,
  int? executionTimeMs,
  bool? hasMore,
  String? nextPage,
}) {
  return SearchResult(
    query: query ?? this.query,
    items: items ?? this.items,
    totalCount: totalCount ?? this.totalCount,
    executionTimeMs: executionTimeMs ?? this.executionTimeMs,
    hasMore: hasMore ?? this.hasMore,
    nextPage: nextPage ?? this.nextPage,
  );
}