enhanced_pagination_view 1.1.0
enhanced_pagination_view: ^1.1.0 copied to clipboard
Powerful pagination package with O(1) item updates, dual mode support (infinite scroll + pagination buttons), and comprehensive state management.
1.1.0 - 2025-12-19 #
Added #
PagingController.snapshot()/restoreFromSnapshot(...)to cache and restore paging state (items, page index, flags).PagingAnalytics<T>hooks for page request/success/error and state-change tracking.EnhancedPaginationView.scrollViewKeyto support scroll position restoration viaPageStorageKey.
Improved #
- Concurrency safety: stale in-flight page results are ignored after
refresh()/restore.
1.0.0 - 2025-12-19 #
π Initial Release #
Changed #
- Default
PagingConfig.cacheModeisCacheMode.limited(defaultmaxCachedItemsstays 500) to prevent unbounded memory growth in infinite scroll.
Improved #
PagingControllerkeeps its internal item list growable (safer when fetchers return fixed-length lists).PagingController.loadNextPage()updates the keyβindex map incrementally when possible; rebuilds only when cache trimming shifts indices.
Fixed #
- Example: SnackBars replace the previous one immediately and reliably auto-dismiss.
- Example: Replaced deprecated
withOpacityusage.
Features
- β Dual Mode Support: Infinite scroll or pagination buttons
- β O(1) Item Updates: Direct item manipulation using key-based lookup
- β Comprehensive State Management: 7 states (initial, loading, loaded, loadingMore, error, empty, completed)
- β
Item Management Methods:
updateItem(): Update single item without refreshremoveItem(): Remove item from listinsertItem(): Insert at specific positionappendItem(): Add to end of list
- β Pull-to-Refresh: Built-in refresh functionality
- β Error Handling: Automatic retry mechanism with custom error widgets
- β Customizable UI: Custom loaders, empty states, pagination controls
- β Type Safe: Full generic type support
- β Performance Optimized: Map-based tracking for O(1) lookups
- β Well Documented: Comprehensive comments and README
Why This Package?
Solves major limitations of pagination_view:
- No direct item access β β Direct access β
- No item updates β β O(1) updates β
- Limited state management β β 7 states β
- No pagination mode β β Dual mode β
Technical Details
- Minimum Flutter SDK: 3.0.0
- Dart SDK: >=3.0.0 <4.0.0
- Zero external dependencies (except Flutter)
- Null-safe
- Well-tested
Credits #
Built with β€οΈ to solve real-world pagination challenges in Flutter apps.