Colors.red in a Flutter widget. Sounds harmless. In a production app with a design system, it's a landmine: one developer uses Colors.red , another uses Theme.of(context).colorScheme.error , and six months later your app ships with two shades of red on the same screen and nobody can explain why.
We had this problem across two production Flutter codebases (105K LOC and 59K LOC). Instead of writing a style guide nobody reads, we wrote 19 custom lint rules using the custom_lint framework. 13 are org-wide (published as kx_lints on pub.dev). 6 are project-specific.
I wrote a preprint measuring the results: DOI: 10.5281/zenodo.24263596 .
The Drift Problem
Design-system drift is when developers bypass your theme and use hardcoded values.…