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.enable: false stops generation for that module and removes the previously generated Dart file.pubspec.yaml. Smart diffing ensures builds only run when necessary.23.7s to 1.512s (15.67x faster, 93.6% lower total time), while average per-module write time dropped from 1339.88ms to 7.62ms (175.72x faster, 99.4% lower).For first-time users, use the one-click setup:
Tools -> Flutter Assets Generator -> Setup Project Configuration.Flutter: Setup Current Module to configure only that module.Project activation and module setup follow these rules:
pubspec.yaml directory and contain Flutter configuration (flutter: or Flutter SDK dependency)..dart_tool, build, .symlinks, .plugin_symlinks, and ephemeral are excluded from module detection.lib/ or assets/ do not show the entry.package_parameter_enabled defaults to false for Flutter apps and add-to-app Flutter modules, and defaults to true for other Flutter packages.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 for robust), string (default for legacy) name_style: camel # Options: camel (default), snake package_parameter_enabled: false # Flutter packages default to true path_ignore: []flutter_assets_generator: # Enable/Disable this plugin for the current module. Default: true when the block exists enable: true # When set to false, generation stops and the previous generated Dart file is removed # 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 # Leaf type: class (typed wrappers) or string (raw asset path). Default: class for robust, string for legacy 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 leaf_type: string, asset references return raw String paths (e.g., Assets.icons.user returns a string). In this mode the plugin will not auto-add flutter_svg, lottie, or rive.
When style: legacy and leaf_type: class, the generator keeps flat access paths but wraps known asset types with typed helpers:
// legacy + leaf_type: classstatic const AssetGenImage imagesLogo = AssetGenImage('assets/images/logo.png');static const SvgGenImage iconsHome = SvgGenImage('assets/icons/home.svg');// Unknown types (e.g. mp4, json) still fall back to Stringstatic const String videosIntro = 'assets/videos/intro.mp4';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;