搜尋套件、儲存庫與 APP 分類

套件詳情v3.7.1

cached_query

一個用於處理 Dart 和 Flutter 中伺服器狀態的簡單程式庫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.9萬
喜歡數
103
Pub 分數
160

安裝套件

flutter pub add cached_query

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

CachedQuery 是一個輕量級的 Dart 與 Flutter 庫,專為簡化伺服器狀態管理而設計,提供直觀的方式來快取、取得與重新整理來自遠端來源的資料。它協助開發者使用內建的快取機制處理非同步資料擷取,減少重複的網路呼叫並提升應用效能。此套件支援多種平台,包括 Android、iOS、Web、macOS、Windows 及 Linux,適用於跨平台應用程式。它可透過簡單明確的 API 順暢整合至 Flutter 專案中。

適用情境

  • 快取 API 回應
  • 減少重複的網路請求
  • 在Flutter應用中管理伺服器狀態
  • 實施離線優先的資料策略
  • 在應用重啟之間同步資料
  • 透過快取資料提升UI回應速度

主要特色

  • 內建快取層
  • 自動快取失效
  • 支援非同步資料檢索
  • 跨平台相容性
  • 簡單 API 結合
  • 可設定的快取過期

適合對象

  • Flutter 開發人員管理伺服器狀態
  • 需要高效數據緩存的應用程式
  • 旨在實現離線功能的專案
  • 尋求數據獲取最小樣板程式碼的開發者
  • 注重性能和用戶體驗的團隊

使用建議

  • 需要理解 async/await 模式
  • 快取大小和驅逐策略可能需要自訂
  • 不適用於大規模即時資料同步
  • 僅限基本快取需求,不支援衝突解決等進階功能

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Cached Query

Visit the documentation for more information.

A small collection of dart and flutter libraries inspired by tools such as SWR, RTKQuery, React Query, Urql and apollo from the React world.

Cache any the response of any asynchronous function (usually external api requests) for a fast and snappy user experience.

The repo is made of three packages:

  • The base package, Cached Query, has no flutter dependencies and can therefore be used in any dart project.
  • Cached Query Flutter adds some useful flutter tools such as connectivity re-fetching and focus re-fetching.
  • Cached Storage is a persistent storage addon for flutter apps.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。