From 032376a4d75d4e5fa0b44976625fcc287d001e31 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Wed, 22 Jul 2026 19:42:57 +0200 Subject: [PATCH] theme.dart: define secondary/tertiary ColorScheme roles Found via on-device testing after the earlier warm-palette commit: the View/Guided/Raw SegmentedButton's selected segment rendered in Flutter's stock Material teal, not the warm palette. Neither ColorScheme.light() nor .dark() defined secondary/tertiary (or their container/on- variants), so any M3 widget reaching for secondaryContainer (SegmentedButton, Chips, etc.) silently fell back to the framework default instead of erroring -- a gap invisible in static review or widget tests, only visible rendered. The shared palette has one accent, not a separate secondary hue, so these mirror primary; secondaryContainer/tertiaryContainer use the line-light/ line-dark border color as a distinguishable-but-subtle selected-state fill. Verified: flutter analyze clean, 188/188 tests at 100% coverage, re- verified identical in an isolated worktree, and confirmed live on the physical phone (adb install -r + screenshot) -- the Raw tab now renders gold/amber instead of teal. Co-Authored-By: Claude Opus 4.8 --- lib/ui/theme.dart | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/ui/theme.dart b/lib/ui/theme.dart index b7d1957..ad7bda9 100644 --- a/lib/ui/theme.dart +++ b/lib/ui/theme.dart @@ -18,6 +18,19 @@ ThemeData buildLightTheme() { outline: Color(0xFFE0DAD7), // line-light primary: Color(0xFFB8862E), // accent onPrimary: Color(0xFF211D1B), // on-fill — filled surfaces use dark text + // secondary/tertiary — the shared palette has one accent, not a + // separate secondary hue, so these mirror primary. Without an explicit + // value here, widgets that reach for secondaryContainer (e.g. + // SegmentedButton's selected segment) silently fall back to Flutter's + // stock Material teal — confirmed live on-device, not just in theory. + secondary: Color(0xFFB8862E), // accent + onSecondary: Color(0xFF211D1B), // on-fill + secondaryContainer: Color(0xFFE0DAD7), // line-light + onSecondaryContainer: Color(0xFFB8862E), // accent + tertiary: Color(0xFFB8862E), // accent + onTertiary: Color(0xFF211D1B), // on-fill + tertiaryContainer: Color(0xFFE0DAD7), // line-light + onTertiaryContainer: Color(0xFFB8862E), // accent error: Color(0xFFE2585F), // danger onError: Color(0xFF211D1B), // on-fill ); @@ -35,6 +48,14 @@ ThemeData buildDarkTheme() { outline: Color(0xFF463E3A), // line-dark primary: Color(0xFFB8862E), // accent onPrimary: Color(0xFF211D1B), // on-fill + secondary: Color(0xFFB8862E), // accent + onSecondary: Color(0xFF211D1B), // on-fill + secondaryContainer: Color(0xFF463E3A), // line-dark + onSecondaryContainer: Color(0xFFB8862E), // accent + tertiary: Color(0xFFB8862E), // accent + onTertiary: Color(0xFF211D1B), // on-fill + tertiaryContainer: Color(0xFF463E3A), // line-dark + onTertiaryContainer: Color(0xFFB8862E), // accent error: Color(0xFFE2585F), // danger onError: Color(0xFF211D1B), // on-fill );