load method

  1. @override
Future<LottieComposition> load()

Implementation

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

    var data = handleJsonData(await chosenBundle.loadString(keyName));
    final iconData = Uint8List.fromList(utf8.encode(data));

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

    return composition;
  });
}