Skip to content
pubscout

cached_annotation

1.8.1, released a year ago by iteo.com

Provides annotations for the Cached code‑generator to define caching behavior.

WASM-ready
$ flutter pub add cached_annotation
Source repository

What it does

The package supplies a set of annotations that the Cached generator uses to create caching logic, including persistent storage and update mechanisms. It does not contain runtime code; it only works together with the cached package.

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

Use it when

  • You are using the cached package and want compile‑time generated caching logic
  • You need annotations for persistent, lazy, or updateable cache behavior

Skip it when

  • You are not using the cached package or prefer manual caching implementations

Strengths

  • Lightweight annotation‑only library
  • Rich set of cache‑related annotations (persistent, lazy, update, delete, etc.)
  • Works seamlessly with the cached code‑generator

Weaknesses

  • Useless without the cached package
  • No runtime functionality on its own
  • Limited to annotation use‑cases

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Add the dependency and run build_runner together with the cached package; no native permissions required

Alternatives

Packages that do the same job and could replace cached_annotation.

Works with

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