finish v3

This commit is contained in:
Rene Kievits
2025-11-02 19:00:17 +01:00
parent 16da0f04ac
commit 5f1b9ba12e
16 changed files with 396 additions and 285 deletions

View File

@@ -19,13 +19,19 @@ class KanjiCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final bgColor = backgroundColor ?? theme.cardTheme.color ?? theme.colorScheme.surface;
final fgColor = textColor ?? theme.textTheme.bodyMedium?.color ?? theme.colorScheme.onSurface;
final bgColor =
backgroundColor ?? theme.cardTheme.color ?? theme.colorScheme.surface;
final fgColor =
textColor ??
theme.textTheme.bodyMedium?.color ??
theme.colorScheme.onSurface;
return Card(
elevation: theme.cardTheme.elevation ?? 12,
color: bgColor,
shape: theme.cardTheme.shape ?? RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
shape:
theme.cardTheme.shape ??
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
child: SizedBox(
width: 360,
height: 240,

View File

@@ -39,7 +39,11 @@ class OptionsGrid extends StatelessWidget {
Color currentTextColor = fg;
if (showResult) {
if (correctAnswers != null && correctAnswers!.contains(o)) {
final normalizedOption = o.trim().toLowerCase();
if (correctAnswers != null &&
correctAnswers!
.map((e) => e.trim().toLowerCase())
.contains(normalizedOption)) {
currentButtonColor = theme.colorScheme.tertiary;
}
}
@@ -51,6 +55,8 @@ class OptionsGrid extends StatelessWidget {
style: ElevatedButton.styleFrom(
backgroundColor: currentButtonColor,
foregroundColor: currentTextColor,
disabledBackgroundColor:
theme.colorScheme.surfaceContainerHighest,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
@@ -58,7 +64,9 @@ class OptionsGrid extends StatelessWidget {
),
child: Text(
o,
style: theme.textTheme.titleMedium?.copyWith(color: currentTextColor),
style: theme.textTheme.titleMedium?.copyWith(
color: currentTextColor,
),
textAlign: TextAlign.center,
),
),
@@ -66,4 +74,4 @@ class OptionsGrid extends StatelessWidget {
}).toList(),
);
}
}
}