loadMore method

Future<void> loadMore()

Implementation

Future<void> loadMore() async {
  if (state is AbstractListFilterablePaginatedState) {
    (state as AbstractListFilterablePaginatedState).searchModel.increment();

    await onBeforeLoadMore();

    try {
      updateState(
          await convertResultToStateAfterLoadMore(await resolveData()));
    } catch (e) {
      await for (final result in resolveStreamData()) {
        updateState(await convertResultToStateAfterLoadMore(result));
        await onAfterLoadMore(result);
      }
    }
  }
}