api_cache_manager
1.0.2, released 5 years ago by snippetcoder.com
Stores REST API responses in SQLite for offline access
$ flutter pub add api_cache_managerWhat 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.
- hive_local_storage
A wrapper around hive_ce for easy local data storage and encryption.
70Compare - realm
A local NoSQL database for Flutter/Dart with object‑oriented API and live query streams.
65Compare - http_cache_mmkv_store
MMKV-based cache store for Dio HTTP requests
73Compare - mysql_utils
A helper library that makes MySQL database operations simpler using mysql_client_plus.
67Compare
Works with
Packages commonly used together with api_cache_manager: ones it builds on, ones built on it, and its own family.