king_cache
0.0.61, released 3 weeks ago by kingtechnologies.dev
File‑ and IndexedDB‑based cache for API responses and markdown content.
What it does
Provides functions to store, retrieve, and manage cached API data and markdown files with optional expiry. Supports web (IndexedDB) and mobile/desktop file systems, plus basic logging.
AI-written summary of version 0.0.61, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to reduce network calls by reusing previous API responses
- You need simple offline access to markdown documentation
- You need a quick file‑based cache without setting up a database
Skip it when
- You require encrypted or secure storage
- You need real‑time sync or complex relational queries
- You depend on a large, actively maintained caching library
Strengths
- Works on all Flutter platforms including web
- Built‑in expiry and markdown‑specific helpers
- Simple API with minimal setup
Weaknesses
- Limited to file/IndexedDB storage, no encryption
- Small community and few updates
- No built‑in cache size management
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 11
await CacheViaRestService.call('https://api.example.com/data',onSuccess:(data)=>print(data),isCacheHit:(hit)=>print('hit: $hit'),shouldUpdate:false,expiryTime:DateTime.now().add(Duration(hours:1)));Alternatives
Packages that do the same job and could replace king_cache.
- flutter_cache_manager
Mature file‑based cache with eviction policies and broader community support
91Compare - shared_preferences
Simple key‑value storage for small cached items
97Compare - sqflite
Full SQLite database when you need structured, queryable cache
96Compare
Works with
Packages commonly used together with king_cache: ones it builds on, ones built on it, and its own family.
- webking_cache depends on itLightweight bindings for browser APIs via JS interop
- intlking_cache depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- path_providerking_cache depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- url_launcherking_cache depends on itFlutter plugin for launching URLs across mobile, desktop, and web platforms.
- package_info_plusking_cache depends on itFlutter plugin to query app package info like version, build number and installer store.
- device_info_plusking_cache depends on itProvides detailed information about the current device, make, model, and OS version.
- permission_handlerking_cache depends on itCross-platform API to check and request permissions on iOS, Android, Web, and Windows.
- loggerking_cache depends on itAn extensible logger for printing formatted logs with levels, custom filters, and printers.