MinimalMediaSource class abstract final

A declared media slot's photograph as an ImageProvider, for the APIs that take one rather than a slot id (a kit's image:, a section's picture:, a sample's image: (name) => …), so no page loads assets/media/ by hand.

It resolves as MinimalMedia.media does: the bundled assets/media/<slot>.jpg first, else the durable link assets/media/remote.json maps the slot to. A link whose photo is still being made is asked again until the photo lands; one that failed (404), never lands within 15 minutes, or a slot with neither ends as an image error, so the taker paints its own placeholder.

Image(image: MinimalMediaSource.image('hero-bakery'), fit: BoxFit.cover)

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

reference ↔ MinimalMediaReference? Function(BuildContext context, String value)?
Reads a picture value that is no plain slot id: an app's own reference to a photo it stored, one on this device, a link. A record's picture field holds a slot id or such a reference; MinimalMedia.media and MinimalAvatar(media:) ask this for every value they are given. Its answer names the slot the value stands for, or the image that draws it; an answer with neither draws the placeholder, and null (or no reader) takes the value as a slot id. The app sets it once.
getter/setter pair

Static Methods

image(String slotId) → ImageProvider<Object>
The photograph of the declared media slot slotId.