qmetrics.net

FlutterGen

Type-safe Flutter code generator for assets

FlutterGen screenshot

FlutterGen generates Dart code for assets, fonts, and colors declared in pubspec.yaml so apps avoid hard-coded path strings. It runs via build_runner or a standalone CLI.

Overview

FlutterGen is a code generator for Flutter projects that turns asset, font, and color declarations into typed Dart APIs. The goal is to replace fragile string paths with generated references that catch typos at compile time.

Configuration lives under flutter and fluttergen keys in pubspec.yaml, with optional overrides in build.yaml when used alongside build_runner. It can emit assets.gen.dart, fonts.gen.dart, and colors.gen.dart under lib/gen by default, and supports flavored assets, glob excludes, package parameters, and directory path getters.

Asset generation can attach image metadata, optional animation details for GIF and WebP, and integrations for flutter_svg, Rive, and Lottie. Color input can be parsed from XML, including special material-style shades.

You can install it as a dev dependency with build_runner, activate it as a global Dart CLI on macOS, Linux, and Windows, or use Homebrew, asdf, or a GitHub Action setup step. Workspace mode discovers multiple packages from a root pubspec and generates per member.

Key features

  • Generated asset path classes
  • Font and color code generation
  • build_runner integration
  • Standalone CLI command
  • Flavored asset support
  • SVG, Rive, Lottie hooks
  • Image metadata parsing
  • Pub workspace builds

Use cases

  • Safer asset references in UI code
  • Large multi-flavor Flutter apps
  • Monorepo workspace generation
  • Typed font family constants
  • Shared color palettes from XML

Tags

Similar software

Dive

Terminal explorer for Docker image layers

Dive inspects container images layer by layer to show what changed and where space is wasted. It helps shrink Docker or OCI images during development and CI.

★ 54.8k⟳ 11 days agoMIT

Nx

Monorepo build system with caching and CI integration

Nx manages TypeScript and polyglot monorepos with task graph awareness, local and remote caching, and CI helpers. It can be added to existing npm, pnpm, or yarn workspaces.

★ 29.5k⟳ todayMIT

PostCSS

JavaScript toolkit for transforming CSS via plugins

Parses CSS into an AST and runs JavaScript plugins to lint, prefix, nest rules, inline assets, and apply other style transforms in build pipelines.

★ 29k⟳ yesterdayMIT

Emscripten

LLVM toolchain compiling C and C++ to WebAssembly

Emscripten turns C and C++ into WebAssembly via LLVM and Binaryen. Output runs in browsers, Node.js, and other WebAssembly runtimes.

★ 27.8k⟳ 2 days agoMIT · open core

Oxc

Rust-based JavaScript and TypeScript compiler toolkit

Oxc bundles a parser, linter, formatter, transformer, resolver, and minifier for JavaScript and TypeScript. Oxlint and Oxfmt run via npx for everyday lint and format tasks.

★ 23.6k⟳ todayMIT

Slim

Container inspection, minification and security profiling CLI

SlimToolkit is a command-line toolkit for inspecting, shrinking and hardening container images without rewriting your Dockerfile. It analyzes what your application actually needs and strips unused layers and files.

★ 23.6k⟳ 2 months agoApache-2.0