copyWhenError method
create new instance of FetchingState.
set status to LoadState.error
keep the current data
and error
or user can pass in those parameter.
this method should be use after loading more item into data
Implementation
FetchingState<T> copyWhenError({
T? data,
Object? error,
}) {
return FetchingState(
fetchingStatus: LoadState.error, error: error, data: data ?? this.data);
}