Skip to content
pubscout

king_cache

0.0.61, released 3 weeks ago by kingtechnologies.dev

File‑ and IndexedDB‑based cache for API responses and markdown content.

$ flutter pub add king_cache
Source repository

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.

Works with

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