mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-10 19:07:02 +01:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
2ed9267e06
commit
032376a4d7
@ -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
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user