flutter_pagination_pro 0.2.0
flutter_pagination_pro: ^0.2.0 copied to clipboard
Zero-dependency Flutter pagination: infinite scroll, load more button, grid view, slivers, and numbered pagination. Built-in loading/error/empty states, pull-to-refresh, cache-first initialItems, page [...]
Changelog #
0.2.0 #
New Features #
pageSizeauto last-page detection: SetpageSizeinPaginationConfigto automatically detect the final page when fewer items than expected are returned — eliminates phantom "loading more" spinners.initialItemssupport: Prepopulate the list with cached data viaPaginationController(initialItems: [...]). The controller starts inloadedstate, skipping the initial load.totalItems/setTotalItems: Track the total item count from your API. Callcontroller.setTotalItems(total)to display "Showing X of Y" and auto-complete when all items are loaded.findChildIndexCallbackpassthrough: All scroll widgets (PaginationListView,PaginationGridView,SliverPaginatedList,SliverPaginatedGrid) now acceptfindChildIndexCallbackfor improved performance during item mutations.
Improvements #
PaginationConfignow supportspageSizefield with proper==/hashCode/copyWith.PaginationStatenow includestotalItemsfield with proper==/hashCode/copyWith/toString.
0.1.0 #
Breaking Changes #
PaginationConfig: ReplacedinvisibleItemsThresholdwithscrollThreshold(in pixels, default 200.0) for clearer, more accurate scroll-triggered loading.onPageLoaded: Now fires with only the new items loaded on that page instead of the full accumulated list.PaginationGridView: Removed unusedmainAxisSpacingandcrossAxisSpacingparameters (they were accepted but never applied). Set spacing viagridDelegateinstead.
Bug Fixes #
- Refresh no longer wipes the screen:
controller.refresh()now keeps existing items visible while reloading, instead of replacing everything with a full-page loading spinner. DefaultLoadMoreErrornow shows the actual error: Previously hardcoded "Failed to load more" and ignored theerrorfield.
New Features #
- Sliver variants: Added
SliverPaginatedListandSliverPaginatedGridfor use insideCustomScrollView, enabling composability withSliverAppBar,SliverToBoxAdapter, and other slivers. - Pull-to-refresh: Added
enablePullToRefreshparameter toPaginationListViewandPaginationGridView. - Accessibility: Added semantic labels to
NumberedPaginationbuttons for screen readers. NumberedPaginationConfig: Added==andhashCodefor proper equality comparison.
Improvements #
- Shared pagination mixin: Extracted
PaginationStateMixinto eliminate code duplication betweenPaginationListViewandPaginationGridView. - Config from controller: When using
.withController(), config is now read from the controller instead of widget defaults. - Fixed README: Corrected parameter tables to match actual API.
0.0.1 #
Initial release.
Features #
- PaginationListView - ListView with pagination support
- PaginationGridView - GridView with pagination support
- NumberedPagination - Page number navigation widget
- PaginationController - Programmatic control for pagination
Pagination Modes #
- Infinite Scroll - Auto-load when scrolling near bottom
- Load More Button - Manual button to load next page
- Numbered - Classic page number navigation
Highlights #
- Zero external dependencies
- Fully customizable UI components
- Built-in loading, error, and empty states
- Type-safe generic API
- Separator support for ListView