PrismLottieCache class

Preloads Lottie animations from an asset directory.

Useful for a splash screen or an onboarding flow, where you want to have the animations ready before the screen is shown.

final preloaded = await PrismLottieCache.preload([
  'animations/success.json',
  'animations/error.json',
]);
final success = preloaded['animations/success.json'];

Constructors

PrismLottieCache()
Creates a cache.

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

evict(String path) → void
Removes an animation from the cache.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preload(List<String> paths) → Future<Map<String, PrismLottie>>
Loads and caches each animation.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](String path) → PrismLottie?
A previously loaded animation, or null.