pagy 1.2.0
pagy: ^1.2.0 copied to clipboard
A Flutter package for easy pagination with API data fetching, customizable UI, shimmer effects, error handling, and smooth scrolling.
1.2.0 #
đ¯ Horizontal ListView & Dynamic Height Support #
- ⨠New Widget: Added
PagyHorizontalListView<T>for horizontal scrolling pagination. - đ Dynamic Height Support: Added
useDynamicHeightparameter for intrinsic sizing support. - đ Column/Flex Layout Ready: Height is automatically determined by content when
useDynamicHeight: true. - đī¸ Smart Auto-Fallback: Automatically detects unbounded height constraints and switches to dynamic layout - fixes "Horizontal viewport was given unbounded height" errors!
- đĄī¸ PagyObserver Enhancements: Added
nullBuilderfor custom null controller handling. - đ Feature Parity: Full support for shimmers, error states, and empty states in horizontal mode.
- đ¨ Customizable Spacing: Easy configuration of
itemSpacingandseparatorBuilder. - â ī¸ Performance Note: Dynamic height builds all items upfront (not lazy) - use with caution for very large lists.
Example Usage #
// Fixed Height (Uses efficient ListView.separated)
SizedBox(
height: 200,
child: PagyHorizontalListView<Category>(
controller: categoryController,
itemBuilderWithIndex: (context, category, index) {
return CategoryCard(category: category);
},
itemSpacing: 12,
),
)
// Dynamic Height (Auto-sized to tallest child - perfect for Columns)
PagyHorizontalListView<Product>(
controller: productController,
useDynamicHeight: true,
itemBuilderWithIndex: (context, product, index) {
return ProductCard(product: product);
},
)
1.1.1 #
đ¯ ItemBuilder Enhancement #
- ⨠Index Parameter Support: Added
itemBuilderWithIndexparameter that includes item index access - đ§ Better Item Builders: Now you can build widgets that need to know their position (e.g., "#1", "#2", etc.)
- đ Backward Compatible: Old
itemBuilder(without index) still works but is deprecated - đ Automatic Migration: Use
itemBuilderWithIndex: (context, item, index) => ...instead ofitemBuilder: (context, item) => ...
1.1.0 #
đ¯ UX Improvements & New Features #
- đ Refresh on Empty: Added support for pull-to-refresh when the list is empty
- đŦ Empty State Customization: Added
emptyStateBuilder,emptyMessage, andemptyIconfor comprehensive empty state customization - ⨠Built-in Response Parsers: Added
PagyParsersclass with pre-built parsers for common API response structures (Laravel, Django, etc.) - đˇī¸ Better Error Handling: Introduced
PagyErrorclass with error types, helpful suggestions, and status codes - đ Pagination Metadata: Added
PagyMetadatafor easy access to pagination info in UI (currentPage,totalPages,progress, etc.) - đ§ Convenience Methods: Added
refresh(),applyFilters(),search(), andloadMore()methods toPagyController - âī¸ Enhanced Configuration: Added validation for
baseUrl, helpful warnings, and better error messages - đ Improved Naming: Introduced clearer parameter names with deprecation strategy:
responseMapperâresponseParseradditionalQueryParamsâquerypaginationModeâpayloadMode(controller & config)apiLogsâenableLogs
- đ Comprehensive Documentation: Complete README rewrite with examples, migration guide, and common use case
- đ Full Backward Compatibility: All old parameter names still work (deprecated, will be removed in v2.0.0)
1.0.0 #
- đ Remapped the entire package to Clean Architecture for improved scalability and maintainability.
- đ Added support for custom headers in API requests.
- đī¸ Introduced a separate builder option in
PagyListViewfor more flexible UI rendering. - âšī¸ Implemented automatic cancellation of previous API calls when new requests are triggered.
- đ Added interceptor support for advanced request/response handling (e.g., token blacklist).
- đ
PagyControllernow integrates seamlessly with both BLoC and Riverpod. - đ§Š Added dependency injection test hooks, removing strict reliance on global
PagyConfig. - đ Enhanced logging system to allow monitoring and saving of request/response logs.
- đ Integrated automatic theme support to adapt to the user's app theme (light/dark).
0.0.4 #
- Added POST request support and enhanced API interactions.
- Improved
.gitignore. - Updated dependencies.
0.0.3+1 #
- Set Dio compatible version.
0.0.3 #
- Fixed dependency issues.
- Updated compatibility for Flutter 3.32.
- Added functionality to limit the number of displayed items.
0.0.2 #
- Fixed logo.
- Improved example.
0.0.1 #
- Initial release.
- Added assets path.