copyWith method

  1. @override
InfiniteQueryState<T> copyWith({
  1. List<T>? data,
  2. int? currentIndex,
  3. QueryStatus? status,
  4. bool? hasReachedMax,
  5. DateTime? timeCreated,
  6. T? lastPage,
  7. dynamic error,
})
override

Creates a copy of the current InfiniteQueryState with the given filed replaced.

Implementation

@override
InfiniteQueryState<T> copyWith({
  List<T>? data,
  int? currentIndex,
  QueryStatus? status,
  bool? hasReachedMax,
  DateTime? timeCreated,
  T? lastPage,
  dynamic error,
}) {
  return InfiniteQueryState(
    lastPage: lastPage ?? this.lastPage,
    hasReachedMax: hasReachedMax ?? this.hasReachedMax,
    error: error ?? this.error,
    data: data ?? this.data,
    status: status ?? this.status,
    timeCreated: timeCreated ?? this.timeCreated,
  );
}