A Flutter package that generates asset declarations from a specified directory, simplifying the management of app resources like images, fonts, and files. It automates the creation of Dart code for assets, reducing manual configuration and minimizing errors in asset references. Ideal for projects with frequent asset updates or large numbers of static resources. The generator supports multiple platforms including Android, iOS, macOS, Windows, and Linux, ensuring cross-platform consistency. It integrates seamlessly into the Flutter workflow via pub add.
Use cases
- Automating asset file declarations
- Managing large collections of images and assets
- Streamlining asset integration across platforms
- Reducing manual errors in asset paths
- Supporting CI/CD pipelines with consistent asset generation
Key features
- Auto-generates Dart asset classes
- Supports multiple platform targets
- Integrates with Flutter's build system
- Customizable output directory
- Handles nested asset folders
Suitable for
- Developers managing many static assets
- Teams requiring consistent asset setup
- Projects using automated build processes
- Flutter apps targeting multiple platforms
- CI/CD environments
Considerations
- Requires proper asset directory structure
- May need configuration for complex asset hierarchies
- Not suitable for dynamic asset loading
- Depends on build_runner for execution
- Assets must be declared before generation