Epic: A
Depends on: TP-04
Source: docs/theme-parser-github-issues.md
Goal
Convert custom shadcn_colors into shadcn_flutter.ColorScheme with fallback values.
Files
lib/core/theme/parser/querya_theme_color_scheme.dart
test/core/theme/parser/querya_theme_color_scheme_test.dart
Implementation
Add pure function:
ColorScheme colorSchemeFromQueryaThemeColors({
required Map<String, String> colors,
required QueryaTheme fallback,
});
Map these keys:
background
foreground
card
cardForeground
popover
popoverForeground
primary
primaryForeground
secondary
secondaryForeground
muted
mutedForeground
accent
accentForeground
destructive
destructiveForeground
border
input
ring
chart1
chart2
chart3
chart4
chart5
Fallback:
- missing key -> fallback
colorScheme value;
- invalid optional color -> fallback value;
- debug log invalid optional key if useful.
Acceptance Criteria
- Function is pure.
- Missing optional keys preserve fallback.
- Full fixture maps distinct expected values.
- Brightness comes from fallback theme, not from colors map.
Tests
- full map uses custom values;
- missing keys use fallback;
- invalid optional color uses fallback;
- chart colors fallback correctly.
Epic: A
Depends on: TP-04
Source:
docs/theme-parser-github-issues.mdGoal
Convert custom
shadcn_colorsintoshadcn_flutter.ColorSchemewith fallback values.Files
lib/core/theme/parser/querya_theme_color_scheme.darttest/core/theme/parser/querya_theme_color_scheme_test.dartImplementation
Add pure function:
Map these keys:
backgroundforegroundcardcardForegroundpopoverpopoverForegroundprimaryprimaryForegroundsecondarysecondaryForegroundmutedmutedForegroundaccentaccentForegrounddestructivedestructiveForegroundborderinputringchart1chart2chart3chart4chart5Fallback:
colorSchemevalue;Acceptance Criteria
Tests