Open josh-burton opened 7 months ago
Could you provide the spec of the format and a use case that how Lottie in Flutter uses that format?
This is document of dotLottie from Lottie: https://lottiefiles.notion.site/Getting-started-with-dotLottie-907cb7b157b34990a7bba7bcae8f21b0
As mentioned in this document, dotLotties is allowing for considerably smaller animation files compared to JSON. It makes Lottie animation file size smaller than JSON and has some benefits in Lottie Development and Design.
lottie package currently supports dotLottie from 3.0.0, I think flutter_gen currently supports .zip and hopefully will support dotLotties ASAP.
Looks like we can accept the .lottie
extension as an easy approach.
EDIT: I was looking at the implementation of the package:lottie
and it seems to require some extra definition which looks inaccessible by the library.
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');
});
}
Consider the above code, the JSON file is manually picked by the iterator. We didn't support generating something like that so the generated assets probably won't have a .lottie
constructor.
Make sense! If you can accept it as extension, I think we should add more docs / notes for require some extra definition attention
decoder
basically is a parameter of Lottie
, it need to be provided customDecoder
for .lottie
file is must do, developers must read documentation and know it before implementation.
Is there an existing issue for this?
Describe the problem
dotLottie is compressed lottie file format that would be great to support
Describe the solution
Support the file format
Additional context
No response
Code of Conduct