copyWith method
QueryState<T>
copyWith({
- QueryStatus? status,
- T? data,
- dynamic error,
- DateTime? dataUpdatedAt,
- DateTime? errorUpdatedAt,
- bool? isFetching,
Creates a copy of the query state with the given fields replaced with the new values.
Implementation
QueryState<T> copyWith({
QueryStatus? status,
T? data,
dynamic error,
DateTime? dataUpdatedAt,
DateTime? errorUpdatedAt,
bool? isFetching,
}) {
return QueryState<T>(
status: status ?? this.status,
data: data ?? this.data,
error: error ?? this.error,
dataUpdatedAt: dataUpdatedAt ?? this.dataUpdatedAt,
errorUpdatedAt: errorUpdatedAt ?? this.errorUpdatedAt,
isFetching: isFetching ?? this.isFetching,
);
}