LayerImageSource class abstract

Where the raw image data for an ImageLayer (or a Scene background) comes from.

This is a pure descriptor — the core engine does not decode images here. New source kinds (e.g. a Flutter asset-bundle resolver, provided by an integration layer built on top of this package) can be added as new subclasses without touching this file.

Named LayerImageSource rather than ImageSource on purpose: several widely used Flutter packages (e.g. image_picker) already export an ImageSource, and this package is meant to be imported unprefixed alongside them.

Implementers

Constructors

LayerImageSource()
Const constructor for subclasses.
const
LayerImageSource.file(String path)
An image read from path on disk at render time. See FileImageSource.
const
factory
LayerImageSource.memory(Uint8List bytes)
An image already available as encoded bytes in memory. See MemoryImageSource.
const
factory

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
toJson() → Map<String, Object?>
Converts to a JSON-safe map, see Scene.toJson. A subclass added outside this file (per this class's own doc comment above) needs its own toJson override, plus a decoder registered via LayerRegistry.registerImageSource to round-trip through Scene.fromJson.
toString() → String
A string representation of this object.
inherited

Operators

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