flutter_gen
                                
                                 flutter_gen copied to clipboard
                                
                                    flutter_gen copied to clipboard
                            
                            
                            
                        Feature Request: Lottie files
Hey there!
Would be great to have integration for the lottie files (through https://pub.dev/packages/lottie). Right now in the project I'm working on we're using the syntax:
Lottie.asset(Assets.animations.animationName)
but would be lovely to achieve it just like for the SVG files through the generated code:
Assets.animations.animationName.lottie()
The trickiest part would be probably to distinguish lottie files from non-lottie files, as it uses .json as the file extension?
@wasabeef would you be interested in a PR for this?. I am using flutter_gen in a project and I would like to generate lottie assets with it.
I think the implementation is almost straight forward, the only thing is the file extension .json is very vague. I was thinking to only support files with the name *_lottie.json. What do you think about it?
@wasabeef would you be interested in a PR for this?. I am using flutter_gen in a project and I would like to generate lottie assets with it.
I think the implementation is almost straight forward, the only thing is the file extension .json is very vague. I was thinking to only support files with the name
*_lottie.json. What do you think about it?
I think it's a good idea. Please implement it.
This issue has been fixed ~a year ago.
As for https://github.com/FlutterGen/flutter_gen/issues/47#issuecomment-966241081 the implementation finds all .json files that contain a json object with specific keys and a version of > 4.4.0. This can still lead to false positives, but seems rare.