How xvrh/lottie-flutter works
Project type and purpose
• This is an open-source Flutter/Dart library (“lottie_flutter”) that parses and renders Adobe After Effects animations (exported as JSON, TGS, or .lottie) in Flutter apps on Android, iOS, macOS, Linux, Windows, and Web.
• The project also includes an “example” Flutter application, unit/integration tests, and several CLI tools for code style, file-list generation, README generation, and publish automation.
File structure
• Top-level directories:
• lib/ → core library code (animation, parser, model, rendering, caching, providers, utils)
• example/ → sample Flutter app demonstrating usage on mobile, desktop, web
• test/ → unit, parser, rendering, golden tests
• tool/ → Dart scripts for code style, README generation, publish workflow
• .github/ → CI workflows (analysis, test coverage, publish on pub.dev)
• Core lib is itself layered into animation (runtime engine), model (data structures), parser (JSON→model), providers (asset I/O), render cache, drawable/rendering surfaces, and widget integration (LottieBuilder, Lottie widget).
README for additional insights
• The README explains
• Widget APIs (Lottie.asset, network, memory)
• Custom controllers and drawing (CustomPainter)
• ValueDelegates for runtime property overrides
• Frame rate control and renderCache mode
• Support for TGS and .lottie with custom decoders
• It positions the library as a drop-in solution in any Flutter UI, with key extension points at asset loading (providers), parsing, and rendering.
Detail is crucial
• Core packages under lib/src (parser, model, animation, providers, render_cache, drawable)
• Optional branches (e.g., renderCache enabled vs default rendering)
• Extension points (ValueDelegate, custom decoders)