TListControllerPagination<T, K> extension

Extension providing pagination functionality for TListController.

Handles both client-side and server-side pagination with methods to:

  • Navigate between pages
  • Change items per page
  • Load more items (infinite scroll)
  • Refresh data
  • Handle search

Example:

// Navigate pages
controller.goToNextPage();
controller.goToFirstPage();

// Change page size
controller.handleItemsPerPageChange(25);

// Infinite scroll
controller.handleLoadMore();

// Search
controller.handleSearchChange('query');

// Get pagination info
print(controller.paginationInfo);
// "Showing 1 to 10 of 100 entries"
on

Properties

advancedSearch → Map<String, dynamic>?

Available on TListController<T, K>, provided by the TListControllerPagination extension

Current advanced search filters.
no setter
canGoToNextPage → bool

Available on TListController<T, K>, provided by the TListControllerPagination extension

Whether there is a next page. For cursor pagination, checks hasMoreItems (from server's hasNextPage). For offset pagination, checks if page < totalPages.
no setter
canGoToPreviousPage → bool

Available on TListController<T, K>, provided by the TListControllerPagination extension

Whether there is a previous page. For cursor pagination, checks if there's cursor history. For offset pagination, checks if page > 1.
no setter
computedItemsPerPage → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The computed items per page (adjusted for last page).
no setter
currentCursor → String?

Available on TListController<T, K>, provided by the TListControllerPagination extension

Current cursor for cursor-based pagination.
no setter
cursorHistory → List<String>

Available on TListController<T, K>, provided by the TListControllerPagination extension

Cursor history stack for backward navigation.
no setter
hasMoreItems → bool

Available on TListController<T, K>, provided by the TListControllerPagination extension

Whether there are more items to load.
no setter
isCursorPagination → bool

Available on TListController<T, K>, provided by the TListControllerPagination extension

no setter
isFirstPage → bool

Available on TListController<T, K>, provided by the TListControllerPagination extension

Whether this is the first page.
no setter
isLastPage → bool

Available on TListController<T, K>, provided by the TListControllerPagination extension

Whether this is the last page.
no setter
itemsPerPage → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The number of items per page.
no setter
nextCursor → String?

Available on TListController<T, K>, provided by the TListControllerPagination extension

Next cursor for cursor-based pagination.
no setter
page → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The current page number (1-indexed).
no setter
pageEndedAt → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The ending index of the current page.
no setter
pageStartedAt → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The starting index of the current page.
no setter
paginationInfo → String

Available on TListController<T, K>, provided by the TListControllerPagination extension

Human-readable pagination information. For cursor pagination (when totalItems is 0 or unavailable), shows current page info. For offset pagination, shows range and total.
no setter
totalDisplayItems → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The number of items currently displayed.
no setter
totalItems → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The total number of items.
no setter
totalPages → int

Available on TListController<T, K>, provided by the TListControllerPagination extension

The total number of pages.
no setter

Methods

clearAdvancedSearch() → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

Clears all active advanced search / filter conditions.
computeItemsPerPageOptions(List<int> options) → List<int>

Available on TListController<T, K>, provided by the TListControllerPagination extension

goToFirstPage() → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

goToLastPage() → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

goToNextPage() → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

goToPreviousPage() → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

handleAdvancedSearchChange(Map<String, dynamic> filters) → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

handleFilterRulesChange(List<TFilterRule> rules, [List<TFilterDef<T>>? defs]) → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

Applies a list of TFilterRule instances, converting them to JSON and updating advanced search.
handleItemsPerPageChange(int newItemsPerPage) → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

handleLoadMore() → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

handlePageChange(int newPage) → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

handleRefresh() → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

handleSearchChange(String search) → void

Available on TListController<T, K>, provided by the TListControllerPagination extension

handleSearchImmediate(String search) → void

Available on TListController<T, K>, provided by the TListControllerPagination extension