Menu

19 Custom Lint Rules Killed Design-System Drift in Two Production Flutter Apps
📰

19 Custom Lint Rules Killed Design-System Drift in Two Production Flutter Apps

DEV Community: dart·Sagar Ghag·about 12 hours ago
#zbJhcsMc
#devtodart#devto#dev#rules#theme
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.