Preload class

A registry of Loaders, and the pool that runs them.

Register loaders once, then load whatever you need, whenever you need it. Each call names its own assets and hands back a PreloadRequest to watch. There is no difference between filling the cache at startup and replacing one entry later; both go through the same loaders.

Ignis.preload
  ..register(.image()..extensions(['.png']))
  ..register(.json()..extensions(['.json']));

final request = await Ignis.preload.load(manifest: true);

Constructors

Preload({int concurrency = _CONCURRENCY, Duration timeout = _TIMEOUT})
Creates a new preload.

Properties

concurrency int
final
hashCode int
The hash code for this object.
no setterinherited
loaders Iterable<Loader>
The loaders every loaded asset is fed through.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
final

Methods

dispose() Future<void>
Releases the worker pool. Loading afterwards throws.
load({Iterable<String> paths = const [], bool manifest = false}) PreloadRequest
Loads assets through the registered loaders, replacing whatever Ignis.cache already holds for them.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(Loader loader) Preload
Registers a loader to feed every loaded asset through.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

run({required Iterable<Loader> loaders, Iterable<String> paths = const [], bool manifest = false, int concurrency = _CONCURRENCY, Duration timeout = _TIMEOUT}) PreloadRequest
Runs one load through a throwaway preload built from loaders.