Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: dotLottie support #505

Open
2 tasks done
josh-burton opened this issue Apr 17, 2024 · 5 comments
Open
2 tasks done

[FR]: dotLottie support #505

josh-burton opened this issue Apr 17, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@josh-burton
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

  • I agree to follow this project's Code of Conduct
@josh-burton josh-burton added the enhancement New feature or request label Apr 17, 2024
@AlexV525
Copy link
Member

Could you provide the spec of the format and a use case that how Lottie in Flutter uses that format?

@dungngminh
Copy link

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.

@AlexV525
Copy link
Member

AlexV525 commented Nov 20, 2024

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.

@dungngminh
Copy link

dungngminh commented Nov 20, 2024

Make sense! If you can accept it as extension, I think we should add more docs / notes for require some extra definition attention

@dungngminh
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants