load method

  1. @override
Future<LottieComposition> load()
override

Implementation

@override
Future<LottieComposition> load() {
  return sharedLottieCache.putIfAbsent(this, () async {
    final chosenBundle = bundle ?? rootBundle;

    var data = await chosenBundle.load(keyName);

    var composition = await LottieComposition.fromByteData(data,
        name: p.url.basenameWithoutExtension(keyName),
        imageProviderFactory: imageProviderFactory);

    for (var image in composition.images.values) {
      image.loadedImage ??= await _loadImage(composition, image);
    }

    return composition;
  });
}