fetchNextPage method

Future<void> fetchNextPage(
  1. PageFetcher<T> fetcher,
  2. int limit
)

Fetches the next page and appends results to items.

Does nothing if a fetch is already in progress, an error is pending, or the end of the list has been reached.

Implementation

Future<void> fetchNextPage(PageFetcher<T> fetcher, int limit) async {
  if (_isLoading || _hasError || _hasReachedEnd) return;
  await _fetch(fetcher, limit);
}