Repository navigation
1.6.1
Fixed
-
ThemeData.scaffoldBackgroundColornow agrees with the colour a themed app actually paints its pages. It was filled fromcolors['background'], or failing that from this package's own white and gray-900, while an app's canvas comes from abg-surfaceclassName alias on a widget of its own. The two are read by different layers and had no reason to agree, and nothing painted a page, so nobody noticed. Measured on one consumer: the alias resolved to#F9FAFBlight and#07090Cdark, against this field's#FFFFFFand#111827.magic0.0.12 starts painting a page background, to stop a pushed route showing the page underneath it through a transparent one, which turns the disagreement into a visibly wrong colour on every screen and is worst in dark mode.colors['background']could not fix it consumer-side either: it holds ONE colour for both brightnesses, and a themed app needs a different canvas in each. The alias already carries both.The alias value is read as TEXT rather than through the parser, which is what makes it safe to call while the theme is being built: the parser resolves a className against a theme, and that theme is what this is assembling. So only a literal
bg-[#hex]is read. An alias naming a palette colour (bg-gray-50), a dark theme whose alias has nodark:pair, and an app with nobg-surfacealias each keep the shipped default, and an explicitcolors['background']still wins over everything. The hex itself goes throughhexToColor, the same helper the parser uses, so the two cannot drift: the shorthand expands, alpha lands first (Flutter packs AARRGGBB where CSS writes RRGGBBAA), and a length that is neither 3, 4, 6 nor 8 is a typo rather than a colour. (lib/src/theme/wind_theme_data.dart,test/theme/scaffold_background_alias_test.dart)