Closed xvrh closed 9 months ago
Lottie.asset( 'sticker.tgs', decoder: LottieComposition.decodeGZip, )
Lottie.asset( 'animation.lottie', decoder: customDecoder, ); Future<LottieComposition?> customDecoder(List<int> bytes) { return LottieComposition.decodeZip(bytes, filePicker: (files) { return files.firstWhere((f) => f.name == 'animations/cat.json'); }); }
LottieComposition
imageProviderFactory
Future<LottieComposition?> decoder(List<int> bytes) { return LottieComposition.decodeZip(bytes, imageProviderFactory: imageProviderFactory); }
Lottie.asset('anim.json', imageProviderFactory: imageProviderFactory, decoder: decoder)
LottieComposition
imageProviderFactory
is not used in .zip file by default anymore. To restore the old behaviour, use:Lottie.asset('anim.json', imageProviderFactory: imageProviderFactory, decoder: decoder)