Skip to content

Commit

Permalink
Exam card type colors
Browse files Browse the repository at this point in the history
  • Loading branch information
thePeras committed Dec 2, 2024
1 parent e3b63df commit 3e34a05
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/uni_ui/lib/cards/exam_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ class ExamCard extends StatelessWidget {
final bool showIcon;
final Function()? iconAction;

static const Map<String, Color> examTypeColors = {
'MT': BadgeColors.mt,
'EN': BadgeColors.en,
'ER': BadgeColors.er,
'EE': BadgeColors.ee,
};

@override
Widget build(BuildContext context) {
return Opacity(
Expand All @@ -47,7 +54,7 @@ class ExamCard extends StatelessWidget {
const SizedBox(width: 8),
Badge(
label: Text(type),
backgroundColor: BadgeColors.er,
backgroundColor: examTypeColors[type],
textColor: Theme.of(context).colorScheme.surface,
),
],
Expand Down

0 comments on commit 3e34a05

Please sign in to comment.