code generation productivity for Dart and Flutter
summary
Chrome of Dart code generation: experimental macros exist but are unstable so rely on build_runner and concrete packages: json_serializable, freezed, retrofit, injectable, auto_route, flutter_gen, i69, BDD widget and a recently released viral_file package. Large mono-repos hit real costs: analyzer can use 13–30 GB RAM, a 400-package workspace needs ~two hours to regenerate; Melos helps parallelize. Recommendations: use generate_for in build.yaml, run freezed then json_serializable then retrofit, commit generated files, collapse diffs and exclude generated files from analyzer and coverage.
AI-written summary · about
chapters (9)
- 0:00Code generation intro
- 3:01Build runner principles
- 6:54Common code gen packages
- 12:40Faster code generation
- 19:26Managing generated files
- 24:47Package dependencies
- 28:22Dev workflow shortcuts
- 30:13Testing best practices
- 31:39Summary
related talks
19mModern JSON Handling in a Macro-less Flutter Era
44mBuilding Pieces for Developers Our Journey with Flutter and Dart
24mFearless Flutter Debugging: When All Else Fails, Hack the Tools!
18mOptimize your productivity with Flutter developer tooling
40mRevving up your Flutter IDE
51mGenerate You Some Code for Great Good
42mBecoming the Metaprogrammer Real World Code Generation
36mcontribute to the Flutter ecosystem.
