copyWith method

ListState<Record, Query> copyWith({
  1. List<Record>? records = const DefaultList(),
  2. ListStage? stage,
  3. Query? query,
})

Creates a copy of this list state but with the given fields replaced with the new values.

Implementation

ListState<Record, Query> copyWith({
  List<Record>? records = const DefaultList(),
  ListStage? stage,
  Query? query,
}) {
  return ListState<Record, Query>(
    records: records is DefaultList ? recordsStore : records,
    stage: stage ?? this.stage,
    query: query ?? this.query,
  );
}