FLUTTER ECOSYSTEM

flutter_asset_generator

Generates the resource file by scanning assets defined in the pubspec.yaml, imitation R file short name.

Latest version
1.2.0
30-day downloads
1.2K
Likes
112
Pub points
130

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

A code generation tool for Flutter that automatically creates a resource class by scanning assets listed in pubspec.yaml, similar to Android's R.java. It simplifies asset access with type-safe, compile-time checked references, reducing errors and improving maintainability. The generated file provides short, readable names for images, fonts, and other assets, streamlining development workflows across multiple platforms.

Use cases
  • Simplifying asset management in large Flutter projects
  • Reducing runtime errors from misspelled asset paths
  • Enabling type-safe access to app resources
  • Automating resource class generation during build
  • Improving code readability with concise asset references
Key features
  • Auto-generates resource class from pubspec.yaml
  • Provides short, clean asset names
  • Type-safe asset access
  • Supports images, fonts, and other assets
  • Cross-platform compatibility
Suitable for
  • Developers managing many assets in Flutter apps
  • Teams seeking to reduce asset-related bugs
  • Projects requiring consistent asset naming conventions
  • Build pipelines needing automated resource generation
  • Apps targeting multiple platforms
Considerations
  • Requires setup of build_runner and dependencies
  • Generated files should not be manually edited
  • May increase build time slightly
  • Needs pubspec.yaml to be correctly configured
  • Best used in conjunction with code analysis tools
Supported platformsAndroidiOSmacOSWindowsLinux

Install package

flutter pub add flutter_asset_generator

Categories

Dependencies

Dependency list 6 items

Source repository

Related projects

No data available yet.