load method

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

Implementation

@override
Future<LottieComposition> load() {
  return sharedLottieCache.putIfAbsent(this, () async {
    var bytes = await io.loadFile(file);
    var composition = await LottieComposition.fromBytes(bytes,
        name: p.basenameWithoutExtension(io.filePath(file)),
        imageProviderFactory: imageProviderFactory);

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

    return composition;
  });
}