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.