A powerful Android Studio / IntelliJ plugin that automatically generates a type-safe, hierarchical asset index for your Flutter projects.
Assets.images.logo).example/ or packages/).style: legacy to generate flat variable names (e.g. Assets.imagesLogo) for easy migration.SVG, Lottie and Rive files..svg(), .lottie() and .rive() methods directly on asset objects.flutter_svg, lottie or rive dependencies.pubspec.yaml. Modules without flutter_assets_generator config are not watched or generated automatically.pubspec.yaml. Smart diffing ensures builds only run when necessary.For first-time users, use the one-click setup:
Tools -> Flutter Assets Generator -> Setup Project Configuration.This will automatically add the default configuration to your pubspec.yaml:
flutter_assets_generator: enable: true output_dir: generated/ output_filename: assets class_name: Assets auto_detection: true auto_add_dependencies: true style: robust # Options: robust (default), legacy (legacy) leaf_type: class # Options: class (default), string name_style: camel # Options: camel (default), snake package_parameter_enabled: false path_ignore: []flutter_assets_generator: # Enable/Disable this plugin for the current module. Default: true when the block exists enable: true # Sets the directory of generated files. Default: generated output_dir: generated/ # Sets the name for the generated file. Default: assets output_filename: assets # Enable package parameter generation (package: 'your_package_name'). Default: false package_parameter_enabled: false # Sets the name for the root class. Default: Assets class_name: Assets # Enable/Disable auto monitoring and dependency management. Default: true auto_detection: true # Add dependencies to pubspec.yaml automatically. Default: true auto_add_dependencies: true # Generation style: robust (Hierarchical) or legacy (Flat legacy). Default: robust style: robust # For robust style: leaf type class (typed wrappers) or string (raw asset path). Default: class leaf_type: class # Name style for generated identifiers. Default: camel name_style: camel # For legacy style: Prefix variable names with parent directory names. Default: true named_with_parent: true # Ignore specific paths. Default: [] path_ignore: ["assets/fonts"]When style: robust and leaf_type: string, the generator keeps the hierarchical API such as Assets.icons.user, but each leaf returns a raw String path. In this mode the plugin will not auto-add flutter_svg, lottie, or rive.
Modules without a flutter_assets_generator block are not monitored automatically. If you run Generate Assets before initialization, the plugin will ask you to run Setup Project Configuration first.
Tools -> Flutter Assets Generator -> Generate Assets.Option(Mac) / Alt(Win) + G.The plugin generates a strict, type-safe hierarchy:
// Standard ImageAssets.images.logo.image(width: 24, height: 24);// SVG (Requires flutter_svg dependency)Assets.icons.home.svg(color: Colors.blue);// Lottie (Requires lottie dependency)Assets.anim.loading.lottie(repeat: true);// Rive (Requires rive dependency)Assets.anims.input.rive(fit: BoxFit.contain);// Custom widget builder - allows you to build any widget with the asset pathAssets.images.logo.custom( builder: (context, assetPath) { return YourCustomWidget(assetPath: assetPath); },); // Get raw path stringString path = Assets.images.logo.path;