load method

  1. @override
Future<LottieComposition> load()

Implementation

@override
Future<LottieComposition> load() {
  return sharedLottieCache.putIfAbsent(this, () async {
    var resolved = Uri.base.resolve(url);
    var bytes = await network.loadHttp(resolved, headers: headers);
    var data = handleJsonData(utf8.decode(bytes));

    final iconData = Uint8List.fromList(utf8.encode(data));

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

    return composition;
  });
}