enhanced_pagination_view 1.2.0
enhanced_pagination_view: ^1.2.0 copied to clipboard
Powerful pagination package with O(1) item updates, dual mode support (infinite scroll + pagination buttons), and comprehensive state management.
1.2.0 - 2025-12-20 #
β‘ Developer Experience Improvements #
Breaking Change
itemKeyGetteris now optional: No longer required for basic pagination use cases- Only needed when using
updateItem()orremoveItem(key: ...) - Basic pagination (load, refresh, append, insert) works without it
- Clear error messages guide developers when key-based operations require
itemKeyGetter
- Only needed when using
Added
PagingController.simple()factory constructor for beginner-friendly usage- Helpful error messages when attempting key-based operations without
itemKeyGetter - Better parameter documentation with clear descriptions and examples
Improved
- Simplified all examples to remove unnecessary
itemKeyGetterusage - Updated README with clear "Simple" vs "Advanced" usage patterns
- Parameter documentation now explains when each feature is needed
- All configuration parameters have improved descriptions
Migration Guide
No migration needed! This is a backward-compatible breaking change:
- Existing code with
itemKeyGettercontinues to work exactly the same - New code can omit
itemKeyGetterfor simpler usage - Key-based
updateItem()andremoveItem()still requireitemKeyGetter
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.