refresh method

Future<void> refresh({
  1. int? page,
})

Resets the controller and reloads the first page.

If page is specified, it refreshes from that page onwards.

Implementation

Future<void> refresh({int? page}) async {
  if (page != null && page > 1) {
    return refreshFromPage(page);
  }
  _currentPage = 1;
  _hasMore = true;
  _error = null;
  items.clear();
  selectedItems.clear();
  _isSelectionMode = false;
  notifyListeners();
  return loadMore();
}