Install this to give every stored-image reference beneath it one cache and one resolution ladder; AppImage is what renders through it.
2
Classes
8
Knobs
Live
Real widgets, built from the real kit. Turn a knob and it rebuilds; the
theme bar above applies the design system's own tokens — including
anything you changed under Customize — and the device selector uses the
same sizes the golden baselines gate on, so what you see here is what CI
holds the widget to.
Press Focus on any preview to take it to the full window —
at a desktop width that renders most devices at 1:1, which is when the
widget's own controls become clickable. The bar always states the device
and the scale, so a shrunk preview says it is shrunk. Esc leaves.
MediaCacheScope
No live preview — media scope — provides one cache and resolution ladder. Its knobs are documented below.
AppImage
No live preview — needs a Size — a hand-written builder is not wired yet. Its knobs are documented below.
The API
MediaCacheScope widget
Publishes a MediaCache to descendants, making remote images and basemap tiles survive an app restart and a dead signal. Entirely optional: with no scope above them, `AppImage` falls back to `NetworkImage` and the map falls back to flutter_map's default network tile provider — the pre-cache behavior,…
Full dartdoc
Publishes a MediaCache to descendants, making remote images and basemap tiles survive an app restart and a dead signal. Entirely optional: with no scope above them, `AppImage` falls back to `NetworkImage` and the map falls back to flutter_map's default network tile provider — the pre-cache behavior, unchanged. The host installs the scope once at the composition root, above the Navigator so pushed routes inherit it, the same placement `AppNetworkAuth` needs. The kit depends only on the MediaCache interface; the host supplies the implementation, which is what keeps the widget layer free of the sync engine.
MediaCacheScopedefault constructor
Knob
Type
Default
What it does
cache *
MediaCache
—
The durable byte cache backing network media below this scope.
child *
dynamic
—
AppImage widget
A tandem-faithful image widget over the shared resolution ladder (storedImageProvider → resolveImageSource → imageProviderFor): local staged bytes, a bundled asset, an authenticated network URL, an origin-relative path, or a branded fallback. Harvested from the detail media header and hardened with…
Full dartdoc
A tandem-faithful image widget over the shared resolution ladder (storedImageProvider → resolveImageSource → imageProviderFor): local staged bytes, a bundled asset, an authenticated network URL, an origin-relative path, or a branded fallback. Harvested from the detail media header and hardened with the decodeSize perf contract (card_deck / gallery / form image editors). decodeSize is REQUIRED — the slot's logical size. The widget DPR-scales it to a decode `cacheWidth` so a multi-megabyte source photo never decodes at full resolution into a thumbnail slot. Reads AppNetworkAuth (headers + base URL) and StagedFilesScope (staged-file local paths) from the tree, plus MediaCacheScope when one is installed — with it, the network and origin branches survive an app restart and a dead signal; without it they fall back to memory-only NetworkImage.
AppImagedefault constructor
Knob
Type
Default
What it does
value *
String
—
The stored image reference — any ladder shape, or blank.
decodeSize *
Size
—
The slot's logical size; DPR-scaled to the decode `cacheWidth`.
errorBuilder
WidgetBuilder?
null
Builds the load-error branch (D5 br5 — path present but the bytes are bad/undecodable) when the caller needs it visually distinct from the absent fallback: a corrupt attachment will not self-heal on the next sync, so it must not read as "no image". `null` (the default) keeps the old behavior —…
fallbackBuilder
WidgetBuilder?
null
Builds the fallback shown for a blank value, a not-yet-staged marker, or a load error. Defaults to a muted placeholder.
fit
BoxFit
BoxFit.cover
How the image inscribes its slot (default BoxFit.cover).
pendingOverlay
Widget?
null
Optional overlay drawn over a `staged://` (pending-upload) image — e.g. an "Uploading…" badge. Shown only on the staged branch.