Skip to content
pubscout

build_runner

2.17.1, released 5 weeks ago by tools.dart.dev

A build system for Dart code generation and modular compilation.

WASM-readyRock solid
$ flutter pub add build_runner
Source repository

What it does

A build system that executes code generators (builders) in Dart and Flutter projects. It supports running single builds or continuous watch modes to automatically update generated files when sources change.

AI-written summary of version 2.17.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using packages that require code generation like json_serializable or freezed
  • You need to automate running builders in watch mode during development

Skip it when

  • Your project does not use any code-generating libraries
  • You want a zero-config setup without build tools

Strengths

  • Integrates seamlessly with popular serialization and utility packages
  • Supports incremental builds and continuous watch mode

Weaknesses

  • Requires running commands via terminal or IDE to update generated files
  • Can slow down build times on large projects

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
30

Add as a dev_dependency in pubspec.yaml and execute via dart run build_runner build or watch.

dart run build_runner watch

Works with

Packages commonly used together with build_runner: ones it builds on, ones built on it, and its own family.