mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-15 08:50:58 +01:00
theme.dart: define secondary/tertiary ColorScheme roles
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 <noreply@anthropic.com>
This commit is contained in:
parent
c935a202cc
commit
a106970b4f
@ -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
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user