Skip to content
pubscout

api_cache_manager

1.0.2, released 5 years ago by snippetcoder.com

Stores REST API responses in SQLite for offline access

WASM-ready
$ flutter pub add api_cache_manager

What it does

The package saves API responses to a local SQLite database and retrieves them by key. It provides methods to add, get, delete, and clear cached data.

AI-written summary of version 1.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need offline access to API data
  • You want to reduce network calls and speed up rendering
  • You prefer a simple key‑value cache backed by SQLite

Skip it when

  • You need caching for large binary files or images
  • You already use a dedicated cache manager like flutter_cache_manager
  • You require advanced cache eviction policies

Strengths

  • Simple API with add/get/delete/clear
  • Built on SQLite for persistence
  • No extra code generation or build steps

Weaknesses

  • Limited to JSON‑like data, not binary
  • No built‑in eviction or expiration logic
  • No support for image or file caching

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
var cacheData = await APICacheManager().addCacheData(APICacheDBModel(key, syncData));
var data = await APICacheManager().getCacheData(key);

Alternatives

Packages that do the same job and could replace api_cache_manager.

Works with

Packages commonly used together with api_cache_manager: ones it builds on, ones built on it, and its own family.