copyWith method

SearchResult copyWith({
  1. String? searchTerm,
  2. int? totalResults,
  3. List<AyahWithSurah>? results,
  4. String? source,
})

Creates a copy of this SearchResult with the given fields replaced with new values

Implementation

SearchResult copyWith({
  String? searchTerm,
  int? totalResults,
  List<AyahWithSurah>? results,
  String? source,
}) {
  return SearchResult(
    searchTerm: searchTerm ?? this.searchTerm,
    totalResults: totalResults ?? this.totalResults,
    results: results ?? this.results,
    source: source ?? this.source,
  );
}