Behind the @ – Dart Annotations in Depth
summary
Shows how annotations become enforceable rules by building a custom analyzer plugin that issues IDE and dart analyze warnings, with a concrete lint that checks a top‑level variable annotated must use const is actually const to prevent dev-only code leaking into production. Demonstrates creating const annotation classes, wiring a lint via custom_lint, and a generator using build_runner to collect annotated symbols into a barrel file — used on a codebase with ~100 engineers and millions of lines.
AI-written summary · about
chapters (9)
- 0:00Dart annotations introduction
- 2:53Built-in annotations
- 6:29Lesser-known annotations
- 10:05Custom annotations for quality
- 13:56Enforcing const usage
- 15:03Analyzer plugins for annotations
- 17:11Annotations in codegen
- 18:37Custom codegen annotations
- 20:00Summary
related talks
35mMachines and Code Analysis - What makes Dart and Flutter run
45mExplaining annotation magic
34mMachines and Code Analysis - What makes Dart and Flutter run
50mRevealing the magic behind Java annotations
42mRevealing the Magic Behind Java Annotations
56mThe Wonders of Java Annotation Processing at Compile Time
30mYour own @Annotation processor
38mBelow the Fold, Adventures in Constancy
