Pagination_Core 是一个轻量级、灵活的包,旨在简化 Flutter 应用中的分页逻辑。它提供了一个可重复使用的分页处理器,可与任何状态管理解决方案(如 Provider、Bloc 或 Riverpod)无缝配合。该包抽象了常见的分页任务,如加载状态、页面获取和错误处理,使开发者能够高效地实现无限滚动或分页列表。通过极少的样板代码,它支持多种平台,包括移动、Web 和桌面端。非常适合需要从 API 流式传输数据且页面大小动态变化的应用。
适合场景
无限滚动列表
API驱动的分页数据
动态页面大小处理
跨平台分页
可自定义的加载状态
主要特点
适用于任何状态管理
最小化样板代码
支持多个平台
处理加载和错误状态
可配置的页面大小
适合对象
使用自定义状态管理的开发者
大型数据集的应用程序
跨平台项目
无限滚动实现
可重用的分页逻辑
使用建议
需要手动与数据源集成
无内置缓存
不针对特定UI组件
依赖外部状态管理
仅限基本分页模式
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
pagination_core
❤️ If you like this project, consider supporting me by buying me a coffee! Every little contribution helps me continue building awesome stuff. Thank you! ☕
pagination_core is a Flutter/Dart package designed to simplify pagination management in applications. This package makes it easy to load data progressively as the user scrolls through a list, reducing memory usage and optimizing performance for large data sets.
🚀 Installation
Add pagination_core to your pubspec.yaml dependencies:
dependencies:pagination_core:^1.0.8Then,run the following command to install the dependency:flutterpubget📄FullExampleAcompleteexampleisavailableintheexamplefoldertoguideyouthroughtheintegrationintoyourproject.💡ContributionContributionsarewelcome!Ifyoufindabugorwanttoaddafeature,feelfreetosubmitapullrequest.