loadError method

  1. @override
void loadError(
  1. dynamic error
)
override

Updates the state with an error when an error occurs while loading data. This method is used to handle errors that occur during the data loading process. It keeps the current item list and next page key unchanged, but sets the error to the provided error object.

@param error The error object that occurred while loading data.

Implementation

@override
void loadError(dynamic error) {
  state = state.copyWith(
    itemList: state.itemList,
    nextPageKey: state.nextPageKey,
    error: error,
  );
}