From a106970b4f802fab481520bf9a6961e90fc4e8e8 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Wed, 22 Jul 2026 19:46:07 +0200 Subject: [PATCH] theme.dart: define secondary/tertiary ColorScheme roles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found via testing todo's app, which shares this theme.dart template and has a SegmentedButton: neither ColorScheme.dark() constructor call defined secondary/tertiary (or their container/on- variants), so any M3 widget reaching for secondaryContainer silently falls back to Flutter's stock Material teal instead of erroring. Confirmed this app has the same live bug — ChoiceChip (slot selector) uses secondaryContainer implicitly, and FilterChip's "Any"/"With photo"/"Without photo" chips in the History filter sheet were rendering in stock teal in production right now. The shared palette has one accent, not a separate secondary hue, so these mirror primary; secondaryContainer/tertiaryContainer use line-dark as a distinguishable-but-subtle selected-state fill. Verified: flutter analyze clean, 436/436 tests, re-verified identical in an isolated worktree, and confirmed live: rebuilt debug + release APKs, installed via adb install -r (no data wipe), screenshotted the real device before/after (the History filter chips went from teal to warm gold/tan), then rebuilt and redeployed the desktop package (install_arch.sh -> pacman -U) and confirmed the running desktop window renders identically. Co-Authored-By: Claude Sonnet 5 --- app/lib/ui/theme.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/lib/ui/theme.dart b/app/lib/ui/theme.dart index b54cb21..93d81d5 100644 --- a/app/lib/ui/theme.dart +++ b/app/lib/ui/theme.dart @@ -21,6 +21,20 @@ ThemeData buildAppTheme() { onPrimary: Color( 0xFF211D1B, ), // on-fill — every filled surface uses 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 in the todo app, + // which shares this same theme.dart template. + 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 );