PaginationResult<T> typedef
PaginationResult<T> = ({Ref<String?> error, Future<void> Function(int page) goToPage, Ref<bool> hasMore, Ref<List<T> > items, Future<void> Function() loadMore, Future<void> Function() loadPrevious, Ref<bool> loading, Ref<int> page, Future<void> Function() refresh, Future<void> Function() reset, Ref<int?> total})
Result type for usePagination.
Implementation
typedef PaginationResult<T> = ({
/// Current items across all loaded pages.
Ref<List<T>> items,
/// Current page number (1-indexed).
Ref<int> page,
/// True while loading.
Ref<bool> loading,
/// Error message if failed.
Ref<String?> error,
/// True if there are more pages.
Ref<bool> hasMore,
/// Total count (if provided by API).
Ref<int?> total,
/// Load a specific page (replaces items).
Future<void> Function(int page) goToPage,
/// Load next page (appends items).
Future<void> Function() loadMore,
/// Load previous page.
Future<void> Function() loadPrevious,
/// Refresh current page.
Future<void> Function() refresh,
/// Reset to first page.
Future<void> Function() reset,
});