enhanced_paginated_view 3.0.0
enhanced_paginated_view: ^3.0.0 copied to clipboard
A highly customizable Flutter widget for paginated list, grid, and sliver views with pull-to-refresh, item deduplication, and load-more support.
3.0.0 #
Added #
EnhancedConfig: New class that carries all presentation/behavior configuration (physics,header,scrollDirection,crossAxisAlignment,removeDuplicatedItems,emptyWidgetConfig,loadingConfig,errorLoadMoreConfig,errorPageConfig), passed toEnhancedPaginatedViewvia a newconfigparameter (defaults toconst EnhancedConfig()).EnhancedPaginationController: New optionalChangeNotifier-based controller exposingpageandisLoadingMore, passed via a newcontrollerparameter. If omitted, one is created and disposed internally.loadMoreThreshold: New parameter (default200) controlling how many pixels before the end of the scrollable a load-more request is triggered.removeDuplicationBy<K>: New extension method onIterable<T>for deduplicating by a derived key (K Function(T) keyOf) without needing to override==.- Exported builder typedefs:
EnhancedBoxBuilder,EnhancedSliverBuilder, andEnhancedRefreshBuilderare now exported from the package barrel file.
Changed #
- Load-more trigger: Now based on proximity to the end of the scrollable (
extentAfter <= loadMoreThreshold) instead of an at-edge trigger, so it no longer misfires near the top of the list. - Deduplication: Deduplicated data is now computed once and memoized instead of being recomputed on every build.
- Reverse pull-to-refresh: Pull-to-refresh now works correctly in the
reversedirection; previously the refresh gesture was silently dropped. - Full-page loading/error state: Whether the page-level loading or error widget is shown is now keyed off an empty data list rather than
page == 1, so consumer-triggered reloads on a non-empty list no longer incorrectly show the full-page state. - Lints: Bumped
flutter_lintsto^5.0.0. - Flutter constraint: Raised the minimum Flutter SDK to
>=3.10.0.
Fixed #
- Duplicate initial fetch: The page counter no longer re-fetches page 1 when the consumer (rather than the widget) triggers the initial load.
- Load-more firing at the top: Load-more no longer incorrectly triggers while scrolled near the top of the list.
- Reverse refresh dropped: Fixed pull-to-refresh being silently ignored when
directionisEnhancedViewDirection.reverse. - Loading state hack removed: Removed a 250ms
Future.delayedused to fake loading-state transitions, replaced with tracking driven by actual status transitions and completion. - Short pages now auto-load (#5): When the loaded items don't fill the viewport (e.g. a small
itemsPerPage/short list on a tall screen), the widget now automatically requests the next page until the viewport is filled orhasReachedMaxis reached. - Pull-to-refresh on short lists (#5): Pull-to-refresh now works even when the content is shorter than the viewport; the scrollable is made always-scrollable while
onRefreshis set so the gesture is always available. - Nested scrollables: Inner scrollables (e.g. a horizontal carousel inside a list item) no longer spuriously trigger the outer load-more.
Breaking Changes #
EnhancedDelegateis now data-only: It only acceptslistOfDataandstatus. All presentation/behavior fields (physics,header,scrollDirection,crossAxisAlignment,removeDuplicatedItems,emptyWidgetConfig,loadingConfig,errorLoadMoreConfig,errorPageConfig) have moved to the newEnhancedConfig, passed viaconfig.itemsPerPageremoved: Page tracking is now handled internally (optionally exposed viaEnhancedPaginationController); there is no replacement parameter.- Config moved to
EnhancedConfig: Any code constructingEnhancedDelegatewith presentation options must be updated to pass anEnhancedConfigvia the newconfigparameter instead. See the README's "Migrating from v2 to v3" section for details.
2.0.2 #
Added #
- Pull-to-Refresh Support: Introduced the
onRefreshcallback, allowing users to refresh the list by pulling down. If not provided, the refresh indicator will be disabled. - Custom Refresh Indicator: Added
refreshBuilder, enabling users to define a custom refresh indicator. If not specified, the default refresh indicator will be used.
2.0.1 #
Removed #
- flutter_svg Dependency: Eliminated reliance on the
flutter_svgpackage to reduce dependencies.
2.0.0 #
Added #
- Sliver Support: Now supports slivers for better integration with
CustomScrollView. - Customization Options: Introduced new properties for customization:
- Custom loading widget
- Custom error widget
- Custom empty widget
- Custom scroll physics
- New Direction Control: Added the
directionproperty, allowing users to control the list direction viaEnhancedViewDirection. - EnhancedDelegate: Introduced
EnhancedDelegateto provide greater control over list behavior and widget customization.
Breaking Changes #
- State Management Update:
showLoadingandshowErrorwere removed in favor ofEnhancedStatus.shouldDeduplicaterenamed toremoveDuplicates.isMaxReachedrenamed tohasReachedMax.
1.0.7 #
1.0.5 #
Added #
- Pagination Enhancements:
- Introduced
itemsPerPageto improve page number calculations. - Added
shouldDeduplicateto remove duplicate items. - New
enhancedDeduplication()extension method to handle duplicate removal.
- Introduced
1.0.4 #
Improved #
- Performance Enhancements: Optimized loading behavior by removing
LoadingModesin favor of a more efficientonLoadMoretrigger mechanism.
1.0.2 #
Improved #
- OnLoadMore Performance: Introduced new loading behaviors:
LoadingMode.smooth: TriggersonLoadMorewhen scrolling reaches 75%.LoadingMode.restrict: TriggersonLoadMoreat 100%.
Added #
- Default Widgets:
- New
emptyWidget. - New
LoadingWidget. - New
errorWidget.
- New
- Custom ScrollPhysics: Users can now modify the
ScrollPhysicsof the list.