appendLastPage method

  1. @override
void appendLastPage(
  1. List<T> newItems
)
override

Append the last page and set the nextPageKey to null

Implementation

@override
void appendLastPage(List<T> newItems) {
  final updatedItems = <T>[...(state.itemList ?? []), ...newItems];
  state = state.copyWith(
    itemList: updatedItems,
    nextPageKey: null, // Indicating this is the last page
    error: null,
  );
}