Skip to content
pubscout

assets_generator

5.0.1, released 3 months ago by fluttercandies.com

Automatically generates asset configs in YAML and Dart constants for single projects and modules.

$ flutter pub add assets_generator
Source repository

What it does

The tool scans asset folders and automatically updates pubspec.yaml configurations. It also generates Dart constant classes to reference your assets safely across your application.

AI-written summary of version 5.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to avoid manually typing asset paths in pubspec.yaml
  • You want type-safe constants for accessing assets in Flutter

Skip it when

  • You prefer manually managing asset entries and strings

Strengths

  • Automatically updates YAML configs
  • Generates Dart constants with customizable naming rules
  • Supports multi-module projects and workspaces

Weaknesses

  • Requires global tool activation and path configuration
  • Relies on external CLI execution rather than a build_runner dependency

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
11

Activate globally via pub and add the pub bin path to your system path.

Image.asset(Assets.assets_images_xxx_jpg);

Alternatives

Packages that do the same job and could replace assets_generator.

Works with

Packages commonly used together with assets_generator: ones it builds on, ones built on it, and its own family.