Skip to content

Commit

Permalink
[exam arrange] disqualified exam card
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Jun 11, 2024
1 parent 2f74381 commit e2812fb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/school/exam_arrange/widgets/exam.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ class ExamCardContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
final time = exam.time;
final titleColor = exam.disqualified ? context.$red$ : null;
final disqualifiedColor = exam.disqualified ? context.$red$ : null;
return [
[
exam.courseName.text(style: context.textTheme.titleMedium?.copyWith(color: titleColor)),
"${exam.courseName}${exam.disqualified ? " | Disqualified" : ""}"
.text(style: context.textTheme.titleMedium?.copyWith(color: disqualifiedColor)),
if (exam.isRetake) Chip(label: i18n.retake.text(), elevation: 2),
].row(maa: MainAxisAlignment.spaceBetween),
Divider(color: context.colorScheme.onSurfaceVariant),
Divider(color: disqualifiedColor ?? context.colorScheme.onSurfaceVariant),
ExamEntryDetailsTable(exam),
if (enableAddEvent && time != null && (UniversalPlatform.isAndroid || UniversalPlatform.isIOS)) ...[
if (!exam.disqualified &&
enableAddEvent &&
time != null &&
(UniversalPlatform.isAndroid || UniversalPlatform.isIOS)) ...[
Divider(color: context.colorScheme.onSurfaceVariant),
buildAddToCalenderAction(),
],
Expand Down Expand Up @@ -56,7 +60,8 @@ class ExamEntryDetailsTable extends StatelessWidget {

@override
Widget build(BuildContext context) {
final style = context.textTheme.bodyMedium;
final disqualifiedColor = exam.disqualified ? context.$red$ : null;
final style = context.textTheme.bodyMedium?.copyWith(color: disqualifiedColor);
final time = exam.time;
return Table(
children: [
Expand Down

0 comments on commit e2812fb

Please sign in to comment.