FlutterGen/flutter_gen
65.3
Adequate · 19 September 2026
3.7k
lines of production code
Dart
primary language
1
measurement over time
What this system is
FlutterGen is a code generation tool for Flutter applications that produces type-safe Dart classes for accessing static assets, colors, and fonts. It supports a wide range of asset formats including images, SVGs, Lottie animations, and Rive files, while also handling complex scenarios like flavored assets and multi-package workspaces. The system provides a command-line interface and a build runner integration to automate the generation process based on project configuration.
How it got here
2020–2021 — Monorepo restructuring and workspace support
19 changes.
The project was restructured into a monorepo using Melos, splitting the codebase into distinct command, core, and runner packages to support multi-package workspaces. This period focused on refactoring the core generator logic to enforce new configuration structures and introducing modular integrations for assets, SVGs, Lottie, and Rive animations. The work culminated in a unified CLI and build runner that coordinate asset generation across workspace members.
2022 — Example app and CLI test expansion
9 changes.
This period focused on establishing a comprehensive example application to demonstrate FlutterGen's capabilities, including support for Lottie, Rive, and SVG assets across multiple platforms. Concurrently, test coverage was expanded to include new Lottie integration assets and validation for the command-line tool's configuration and workspace handling.
2023–2026 — workspace support and asset generation enhancements
8 changes.
This period focused on extending FlutterGen to support Dart workspaces, enabling asset generation across multiple packages with dedicated examples and test fixtures. The work also enhanced the core asset generation capabilities by adding support for Flare assets, SVG vector graphics, and type-safe color and font classes, alongside improved testing infrastructure.
Features
Add example assets for Lottie, images, and color resources
The example application now includes a comprehensive set of static assets to support demonstration scenarios. This adds Lottie animation JSON files (including specific versions like v4.4.0 and v4.3.9, plus a 'wrong' directory for testing), SVG icons for Dart, Fuchsia, KMM, and Paint, color resource definitions in XML, sample JSON data structures, and placeholder image files.
examples/example/assets · high confidence
Add macOS platform support to the example app
The example application now includes a complete macOS target, enabling users to build and run the app on macOS. This adds the native macOS project structure, including the Xcode workspace, Swift application entry points (AppDelegate and MainFlutterWindow), and configuration files. It also registers the Rive plugin via GeneratedPluginRegistrant, allowing the example to utilize Rive animations on the desktop platform.
examples/example/macos · high confidence
Added workspace support example and test fixtures
This change introduces a minimal example demonstrating how to use FlutterGen within a Dart workspace, alongside the corresponding test fixtures required to validate this functionality. The example in \examples/example\_workspace\ shows how to configure \build\_runner\ with the \--workspace\ flag to generate asset accessors across multiple packages (\gallery\_one\, \gallery\_two\), requiring Dart SDK \>=3.7.0 and \build\_runner\ \>=2.12.0. Additionally, test fixtures in \packages/runner/test\_fixtures/workspace/packages/app\ provide a sample package structure with assets, fonts, and colors to support testing of the workspace-aware generation logic.
_examples/example\_workspace, packages/runner/test\fixtures/workspace/packages/app · high confidence
Generated asset, color, and font classes for the example app
The example app now includes generated Dart classes for type-safe asset access, color constants, and font families. The \assets.gen.dart\ file provides typed accessors for images, SVGs, Lottie animations, Rive animations, Flare assets, JSON, and movie files, while \colors.gen.dart\ exposes named color constants and Material color swatches, and \fonts.gen.dart\ defines static font family strings.
packages/core/example/lib/gen · high confidence
Initial commit of the FlutterGen example project
This change introduces a new sample application located in the \examples/example\ directory, demonstrating how to use FlutterGen. The entry includes the standard Flutter project scaffolding, such as \pubspec.yaml\ dependencies, platform-specific folders (Android, iOS, macOS, Web), and configuration files like \analysis\_options.yaml\ and \.gitignore\. It also adds a \.metadata\ file to track the Flutter SDK revision and migration state for the tooling, along with a \README.md\ providing instructions to bootstrap the project using Melos.
examples/example · high confidence
Initial package structure and build configuration
The \packages/runner\ directory has been initialized with standard project scaffolding, including symlinks to the root CHANGELOG, LICENSE, and README files. A \build.yaml\ configuration has been added to enable the \flutter\_gen\_runner\ builder, which generates a \.flutter\_gen.manifest.json\ file during the build process. Additionally, \analysis\_options.yaml\ is configured to inherit the project's linting rules while excluding the example directory from analysis.
packages/runner · high confidence
Initialize iOS example project scaffolding
The iOS example project has been initialized with standard Flutter scaffolding, including the Xcode project and workspace configuration, the main application entry point (AppDelegate), and the necessary asset catalogs for app icons and launch screens. This change establishes the baseline iOS build environment for the example app.
examples/example/ios · high confidence
Introduces FlutterGen build\_runner integration with workspace support
Adds the \flutter\_gen\_runner\ package, providing a \build\_runner\ integration that generates Flutter assets, colors, and fonts. The implementation uses a two-phase approach (a standard Builder and a PostProcessBuilder) to handle configuration-driven output paths, ensuring correct behavior in both single-package and multi-package workspace builds by resolving package roots via \BuildStep\ rather than the process working directory.
packages/runner/lib · high confidence
Introduces new utility functions for type casting, color manipulation, and string formatting
The \packages/core/lib/utils\ directory now includes several new helper files that provide core utility capabilities. \cast.dart\ adds a \safeCast\ function for type-safe casting. \color.dart\ introduces logic to generate Material Design color swatches and accents from a primary hex color, including helper methods for hex conversion and color mixing. \string.dart\ adds extensions and functions to convert strings to camelCase and snakeCase. Additionally, \identifer.dart\ provides utilities to validate and convert Dart identifiers, \formatter.dart\ configures the Dart formatter based on SDK constraints and page width, \log.dart\ sets up a dedicated logger, \map.dart\ offers a recursive map merging utility, \file.dart\ defines a file writer typedef, and \error.dart\ introduces an \InvalidSettingsException\.
packages/core/lib/utils · high confidence
New example app demonstrates FlutterGen asset generation and Rive integration
The example application in examples/example/lib/main.dart has been introduced to showcase FlutterGen's auto-generated asset classes (images, fonts, colors) and integration with the Rive animation library. The app renders various assets including Lottie animations, SVGs, and Rive files, demonstrating how to use generated asset paths and keys, as well as implementing a custom Rive widget with proper lifecycle management for file loaders.
examples/example/lib · high confidence
New example workspace packages with generated asset code
Added two new example packages, gallery\_one and gallery\_two, to the example workspace. gallery\_one includes generated Dart code for image assets (flutter3.jpg) using FlutterGen, while gallery\_two includes generated code for an SVG asset (dart.svg). These changes introduce new library entry points and generated asset classes for these specific example packages.
_examples/example\_workspace/packages/gallery\_one, examples/example\_workspace/packages/gallery\two · high confidence
New example\_resources sample project
Added a new example project in the examples/example\_resources directory to demonstrate FlutterGen usage. The sample includes a README with setup instructions, a colors.xml resource file defining standard colors, a Dart SVG asset, and a Lottie animation JSON file.
_examples/example\resources · high confidence
New generate\_facts.dart script for asset generation testing
A new Dart script, generate\_facts.dart, has been added to the core scripts package to automate the generation of asset, color, and font facts for testing purposes. The script iterates through YAML configuration files in the test\_resources directory, distinguishing between standard pubspec configurations and build-specific ones, and uses the FlutterGenerator to produce corresponding .gen.dart files in the actual\_data output directory, providing detailed error logging to stderr for any failures.
packages/core/scripts · high confidence
Architecture
Project restructured into a monorepo with Melos and updated toolchain versions
The repository has been reorganized into a monorepo managed by Melos, splitting the codebase into separate packages for the command-line tool, core logic, and the build runner, along with example projects. This change introduces workspace support for \build\_runner\ and the CLI, allowing generation across multiple packages. The development toolchain has been updated to Flutter 3.44.4 and Node.js 24.18.0, and standard configuration files for linting, formatting, and dependency management have been added.
(repo-wide) · high confidence
Behavioural changes
1 commit (0 fixes) modifying packages/core/test\_resources/assets/rive
A change to existing behaviour in packages/core/test\_resources/assets/rive — 1 commit, 1 file.
_packages/core/test\resources/assets/rive · low confidence · unverified
Added pre-commit linting hook
A new pre-commit hook has been added to the project to automatically run lint-staged on staged files before each commit, ensuring code style consistency. This change introduces the \.husky/pre-commit\ script which delegates to \pnpm lint-staged --allow-empty\.
.husky · high confidence
Assets generator now enforces new configuration structure and throws errors for deprecated options
The assets generator has been refactored to require configuration options like \style\ and \packageParameterEnabled\ to be placed under \assets.outputs\ in \pubspec.yaml\. If these options are found in their previous locations (e.g., directly under \assets\), the generator now throws an \InvalidSettingsException\ with clear migration instructions, rather than silently accepting or ignoring them. This ensures users are immediately notified of configuration changes required for the new structure.
packages/core/lib/generators · high confidence
Core package split and build configuration
The core package has been split into a standalone module, introducing a dedicated build.yaml that configures json\_serializable options (such as enabling any\_map and checked mode) and adding analysis\_options.yaml to enforce consistent code analysis. This structural change is accompanied by the addition of test resources for handling unknown MIME types and standardizing test concurrency settings.
packages/core · medium confidence
Example app now demonstrates FlutterGen asset generation
The example application in packages/command/example/lib has been updated to showcase the capabilities of FlutterGen. The new main.dart file imports auto-generated asset classes (images, fonts, colors, Rive animations, and Lottie animations) and renders them in a demo UI, replacing previous implementations that may have relied on manual asset handling or other integrations like Flare.
packages/command/example/lib · high confidence
Example app now demonstrates Rive and Lottie animations
The example application in packages/runner/example/lib has been updated to showcase Rive and Lottie animations alongside standard images and SVGs. The main.dart file now includes widgets for displaying Rive animations (such as 'vehicles' and 'skills') and multiple Lottie animations (including 'hamburgerArrow', 'geometricalAnimation', 'alarmClockLottieV440', and 'runningCarOnRoad'), providing users with a concrete reference for integrating these animation formats into their Flutter apps.
packages/runner/example/lib · high confidence
Generated asset and theme classes now include Flare support and vector graphics
The generated code in \packages/runner/example/lib/gen\ has been updated to include a new \$AssetsFlareGen\ class for Flare assets (e.g., \Penguin.flr\) and \$AssetsImagesIconsGen\ for SVG vector graphics (e.g., \[e-mail redacted]\, \fuchsia.svg\). Additionally, the generated image classes now support vector graphics via \SvgGenImage\, and the asset generation includes image dimensions and gapless playback by default. The generated color and font classes remain unchanged, providing static access to colors like \crimsonRed\ and font families like \Raleway\.
packages/runner/example/lib/gen · high confidence
Introduce \`flutter\_gen\_command\` with workspace and version support
The CLI entry point is now implemented in \packages/command/bin/flutter\_gen\_command.dart\, replacing previous inline logic. This update adds a \--workspace\ flag that iterates through all members defined in a pubspec workspace configuration, and a \--version\ flag that displays the current package version. It also supports configuring the pubspec and build file paths via \--config\ and \--build\ options, while enforcing that \--build\ cannot be used simultaneously with \--workspace\.
packages/command/bin · high confidence
New FlutterGenerator class and versioned package entry points
The core library now exposes a \FlutterGenerator\ class that orchestrates the generation of assets, colors, and fonts based on the pubspec configuration, and a \version.gen.dart\ file that hardcodes the package version to 5.15.0.
packages/core/lib · high confidence
Refactored asset integrations into a modular, version-aware architecture
The asset generation logic has been restructured into distinct integration classes (Image, SVG, Lottie, and Rive) that share a common base, enabling better maintainability and specific feature support. Image assets now include generated size metadata and animation details (frames, duration) when enabled, and default to gapless playback with medium filter quality. SVG generation now supports the .vec format via vector\_graphics\_compiler, exposes theme and color mapping options, and correctly handles package paths. Lottie integration now supports ZIP archives and Telegram sticker (.tgs) files, while Rive integration automatically selects the correct code generation strategy based on the installed rive\_flutter version (splitting behavior for versions below and at/above 0.14.0).
packages/core/lib/generators/integrations · high confidence
Refactored settings configuration and asset type handling
The settings module has been restructured to improve configuration management and asset naming. The \Config\ class now explicitly loads and merges options from \pubspec.yaml\, \build.yaml\, and \analysis\_options.yaml\, while also resolving integration versions from \pubspec.lock\. A new \AssetType\ and \UniqueAssetType\ system ensures generated asset identifiers are unique and valid Dart identifiers by handling collisions through extension inclusion or suffix appending. Additionally, support for flavored assets is introduced via the \FlavoredAsset\ class, and the \Import\ abstraction allows for aliased package imports in generated code.
packages/core/lib/settings · high confidence
Regenerated asset, color, and font classes with modern Dart syntax and new asset support
The generated code in the \lib/gen\ directory has been updated to use the \abstract final\ class modifier for generated classes (e.g., \MyColorName\, \MyFontFamily\) and now includes support for additional asset types. Specifically, \assets.gen.dart\ now generates \LottieGenImage\ and \RiveGenImage\ classes to handle Lottie animations (including \.zip\ and Telegram \.tgs\ files) and Rive animations, respectively. It also introduces \SvgGenImage\ for SVG assets and supports flavored assets (e.g., \chip4\ with \flavors: {'extern'}\). The \colors.gen.dart\ and \fonts.gen.dart\ files are regenerated with the new syntax, providing type-safe access to colors and font families.
examples/example/lib/gen · high confidence
Updated example app to showcase Lottie animations
The example application in packages/core/example/lib has been updated to demonstrate Lottie animation support. The main entry point now renders multiple Lottie assets (such as hamburgerArrow, geometricalAnimation, and alarmClockLottieV440) alongside existing Rive animations and static images, providing users with a concrete reference for integrating and displaying Lottie content within the framework.
packages/core/example/lib · high confidence
Updated example asset generation with new image and vector features
The generated asset classes in the example now include image dimensions on \AssetGenImage\, enable \gaplessPlayback\ by default for image assets, and apply \FilterQuality.medium\ for rendering. Support for vector graphics has been added via \SvgGenImage\ for SVG files, while Flare integration has been removed in favor of Rive (\RiveGenImage\).
packages/command/example/lib/gen · high confidence
Fixes
Added coverage validation script and XML version compatibility tests
A new \scripts/coverage.sh\ script was added to validate the Codecov configuration and run Dart coverage reports, ensuring CI coverage metrics are correctly generated. Additionally, a new \scripts/test\_xml\_versions.dart\ script was introduced to verify that the core package remains compatible with both \xml\ 6.x and 7.x versions, addressing a regression risk where transitive dependencies might force incompatible major versions.
scripts · high confidence
Test coverage
Added Lottie animation test assets; Added test coverage for core asset generation and integration logic; Added tests for SvgTheme integration behavior; Added tests for the FlutterGen command-line tool; Added tests for workspace build support; Updated FlutterGen test fixtures for generated asset code.
Dependencies
FlutterGen v5.15.0 release with workspace support and updated integrations
This release updates the FlutterGen code generator to version 5.15.0 across the command, core, and runner packages. It introduces support for Dart SDK ^3.4.0 and adds a new example workspace demonstrating multi-package resolution. The example projects now integrate flutter\_svg ^2.0.0, lottie ^3.0.0, and rive ^0.14.0, while the core package updates its dependencies to include dart\_style ^3.0.0 and archive \>=3.4.0 \<5.0.0. Development tooling is updated with husky 8.0.3, lint-staged ^17.0.0, and prettier ^3.0.3.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 65.
Lenses
- Code Health 98
- Architecture 90
- Maturity 54
- Readiness 67
- Security 70
- Domain Modelling 100
Changes since last survey
- 300 commits — 285 feature/other, 15 fixes
By area
- (root) — 179 commits
- packages/core — 77 commits
- .github/workflows — 23 commits
- examples/example — 7 commits
- (repo) — 3 commits
- packages/runner — 3 commits
- .idea/runConfigurations — 2 commits
- examples/example_resources — 2 commits
- .github/CODEOWNERS — 1 commit
- .github/PULL_REQUEST_TEMPLATE.md — 1 commit
- .vscode/settings.json — 1 commit
- examples/example_workspace — 1 commit
Notable commits
- fix: Fix package root resolution after build_runner 2.14.0 AOT changes (#750)
- fix: Fixes flutter_svg latest version requiring a non null clipBehavior field. (#369)
- fix: Fixes the exclude option descriptions in the README (#536)
- fix: Update PULL_REQUEST_TEMPLATE.md to fix melos command (#434)
- fix: chore: fix concurrency execute with melos. (#563)
- fix: chore: revert release actions
- fix: fix: Make the builder name compatible with both flutter_gen and flutter_gen_runner (#592)
- fix: fix: add package parameter to generated asset provider method (#361)
- fix: fix: add xml 7.x support (#761) (#764)
- fix: fix: provide theme to SvgAssetLoader instead of SvgPicture (#532)
- fix: ✅ Fix tests (#581)
- fix: 💚 Fix artifacts release (#671)
- fix: 💚 Fix invalid codecov config (#622)
- fix: 🔧 [IntelliJ] Fix module configurations (#438)
- fix: 🚨 Fix lints
- change: Add missing parameters in Lottie integration from lottie 3.0.0 (#656)
- change: Add new option parse_animation to parse metadata for animated images (#676)
- change: Add support Telegram Sticker .tgs in Lottie Integration (#659)
- change: Add support for 'useArtboardSize' argument in rive integration (#487)
- change: Add support for deferred components (#576)
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
FlutterGen/flutter_gen was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7c7200d87783043c2784b527096df4f2320e4e66 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.