paging_plus 1.0.0
paging_plus: ^1.0.0 copied to clipboard
Lightweight pagination package. Calculate pages, determine next page to fetch, and handle load-more with optimized data fetching for Flutter & Dart.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-11-03 #
Added #
- Comprehensive test suite with 89 tests:
- 31 tests for
Pageclass (constructor, properties, factory methods, equality, toString) - 58 tests for
Pagingclass (constructor, equality, edge cases, optimization, various scenarios) - 100% code coverage for all public APIs
- 31 tests for
Page.toString()method for better debuggingPaging.toString()method for better debugging- Complete API documentation with examples throughout
Changed #
- BREAKING: Simplified
Pagingclass by removingshouldHasDuplicatesproperty for cleaner API - BREAKING: Renamed
Page.latestPage()toPage.lastOf()for more concise naming - Improved documentation across all classes and methods
- Updated README with comprehensive examples and API reference
- Updated example README to match new API
Removed #
shouldHasDuplicatesproperty fromPagingclass (breaking change)expectedTotalCountproperty fromPageclass
0.0.1-alpha.1 - 2025-11-02 #
Added #
- Initial alpha release of the
paging_pluspackage Pageclass for representing a single page in a paginated dataset- Constructor:
Page(pageNumber, count, remainingsCount) - Properties:
pageNumber,count,remainingsCount,hasRemaining,pageSize,currentTotalCount - Factory method:
Page.latestPage(itemCount, pageSize)- creates the latest page based on item count - Static method:
Page.getPages(itemCount, pageSize)- generates all pages for a dataset - Implements
Equatablefor value equality
- Constructor:
Pagingclass for intelligent pagination request calculation- Constructor:
Paging(pageNumber, pageSize, shouldHasDuplicates) - Factory method:
Paging.next(itemCount, pageSize, [fetchLatestIfHasRemaining, minimumRemainingsToTake, minimumToRequest])with optimization options - Support for optimized pagination to minimize redundant data fetching
- GCD-based algorithm for efficient page size calculation
- Implements
Equatablefor easy comparison
- Constructor:
- Built on Equatable for easy comparison and testing
- Comprehensive dartdoc documentation for all classes and methods
- Detailed README.md with:
- Installation instructions
- Usage examples for basic and advanced scenarios
- Practical examples (infinite scroll, REST API pagination, Flutter ListView)
- Complete API reference
- Explanation of pagination optimization
- Example code demonstrating real-world use cases
- Basic unit tests covering core features
Features #
- π Calculate detailed page information from item counts
- π Intelligently determine the next page to fetch
- β‘ Minimize redundant data fetching with optimized pagination
- π Built-in support for "load more" functionality
- π― Type safe with null safety support
- π Built on Equatable for easy comparison
- β‘ Lightweight with minimal dependencies
- π§ͺ Test coverage for core functionality