Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Flutter
  3. FlutterGen

FlutterGen

MITDartv5.15.0

A Flutter code generator that creates type-safe classes for assets, fonts, and colors to eliminate string-based APIs.

Visit WebsiteGitHubGitHub
1.6k stars186 forks0 contributors

What is FlutterGen?

FlutterGen is a code generation tool for Flutter applications that automatically creates type-safe Dart classes from assets, fonts, and colors defined in the pubspec.yaml file. It eliminates the need for string-based asset paths by generating compile-time safe references that provide autocomplete and prevent runtime errors from typos.

Target Audience

Flutter developers working on medium to large applications who need to manage multiple assets, fonts, and colors while maintaining code safety and developer productivity.

Value Proposition

Developers choose FlutterGen because it provides compile-time safety for asset references, reduces runtime crashes from typos, improves IDE autocomplete, and supports popular Flutter packages like flutter_svg, Rive, and Lottie with dedicated generated methods.

Overview

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

Use Cases

Best For

  • Eliminating runtime errors from asset path typos in Flutter apps
  • Managing large collections of images, fonts, and colors in Flutter projects
  • Integrating SVG, Rive, or Lottie assets with type-safe APIs
  • Working with multi-package Flutter projects using Dart workspaces
  • Generating MaterialColor palettes from XML color definitions
  • Improving developer productivity with IDE autocomplete for assets

Not Ideal For

  • Projects where assets are loaded dynamically at runtime from APIs or user uploads
  • Teams using Flutter's internationalization with 'generate: true' enabled in pubspec.yaml
  • Small prototypes or apps with minimal assets where manual string management is sufficient
  • Developers who prefer lightweight setups without code generation or build_runner dependencies

Pros & Cons

Pros

Compile-Time Safety

Generates type-safe Dart classes that replace error-prone string paths with autocomplete-friendly references, eliminating typos and reducing runtime crashes.

Broad Asset Integration

Supports Flutter SVG, Rive, and Lottie packages with dedicated generated methods, simplifying usage without manual package-specific calls.

Workspace Compatibility

Works seamlessly with Dart pub workspaces and multi-package projects, allowing centralized code generation across complex project structures.

Flexible Configuration

Offers customizable output styles like camelCase and snake_case, plus options for metadata parsing and directory paths to tailor generated code.

Cons

Setup and Integration Complexity

Requires build_runner configuration or global tool installation, and has known conflicts with Flutter's internationalization, necessitating manual workarounds like disabling synthetic packages.

Build Time Overheads

Enabling advanced features like parse_animation 'significantly increases generation time,' slowing down iterative development builds and impacting productivity.

Static Asset Limitation

Focuses on compile-time asset references from pubspec.yaml, making it unsuitable for applications that need to load assets dynamically at runtime from external sources.

Frequently Asked Questions

Quick Stats

Stars1,578
Forks186
Contributors0
Open Issues28
Last commit21 hours ago
CreatedSince 2020

Tags

#dart#developer-tools#code-generator#type-safety#fonts#assets#templates#flutter#code-generation#asset-management#build-tool

Built With

b
build_runner
D
Dart

Links & Resources

Website

Included in

Flutter59.5k
Auto-fetched 10 hours ago

Related Projects

FVMFVM

Flutter Version Management: A simple CLI to manage Flutter SDK versions.

Stars5,514
Forks285
Last commit3 days ago
Very Good CliVery Good Cli

A Very Good Command-Line Interface for Dart created by Very Good Ventures 🦄

Stars2,415
Forks243
Last commit1 day ago
Launcher IconsLauncher Icons

Flutter Launcher Icons - A package which simplifies the task of updating your Flutter app's launcher icon. Fully flexible, allowing you to choose what platform you wish to update the launcher icon for and if you want, the option to keep your old launcher icon in case you want to revert back sometime in the future. Maintainer: @MarkOSullivan94

Stars2,121
Forks425
Last commit1 year ago
Flutter SidekickFlutter Sidekick

A simple app to make Flutter development more delightful

Stars1,688
Forks111
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub