From 1d912abc7d12bcb11360d169e1e98bddc6a2c87e Mon Sep 17 00:00:00 2001 From: checkedear <271323618+checkedear@users.noreply.github.com> Date: Tue, 9 Jun 2026 00:50:01 +0200 Subject: [PATCH] tmp fix: themeless tests --- firka/lib/ui/phone/widgets/info_card.dart | 11 +++++++++-- firka/lib/ui/phone/widgets/lesson.dart | 2 +- firka/lib/ui/phone/widgets/lesson_big.dart | 2 +- kreta_api/lib/src/model/test.dart | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/firka/lib/ui/phone/widgets/info_card.dart b/firka/lib/ui/phone/widgets/info_card.dart index f1ac7ca..c64be3b 100644 --- a/firka/lib/ui/phone/widgets/info_card.dart +++ b/firka/lib/ui/phone/widgets/info_card.dart @@ -56,13 +56,20 @@ class InfoCard extends StatelessWidget { size: 24, ), ), - texts: [test.theme.firstUpper(), test.subject.name.firstUpper()], + texts: [ + test.theme?.firstUpper() ?? test.method.description, + test.subject.name.firstUpper(), + ], right: [buildSubject(color, test.subject)], onTap: (context) => showTestBottomSheet(context, initData, test), ); } factory InfoCard.testDesc(Test test) { + if (test.theme == null) { + return InfoCard.test(test); + } + final color = appStyle.colors.accent; return InfoCard( @@ -76,7 +83,7 @@ class InfoCard extends StatelessWidget { size: 24, ), ), - texts: [test.theme.firstUpper(), test.method.description.firstUpper()], + texts: [test.theme!.firstUpper(), test.method.description.firstUpper()], right: [buildSubject(color, test.subject)], onTap: (context) => showTestBottomSheet(context, initData, test), ); diff --git a/firka/lib/ui/phone/widgets/lesson.dart b/firka/lib/ui/phone/widgets/lesson.dart index 3645891..1291089 100644 --- a/firka/lib/ui/phone/widgets/lesson.dart +++ b/firka/lib/ui/phone/widgets/lesson.dart @@ -244,7 +244,7 @@ class LessonWidget extends StatelessWidget { ); if (test != null && showTests) { - var theme = test!.theme.firstUpper(); + var theme = test!.theme?.firstUpper() ?? ""; var method = test!.method.description.firstUpper(); elements.add( diff --git a/firka/lib/ui/phone/widgets/lesson_big.dart b/firka/lib/ui/phone/widgets/lesson_big.dart index 30ebdc2..5d5698a 100644 --- a/firka/lib/ui/phone/widgets/lesson_big.dart +++ b/firka/lib/ui/phone/widgets/lesson_big.dart @@ -112,7 +112,7 @@ class LessonBigWidget extends StatelessWidget { SizedBox(width: 8), Expanded( child: Text( - test!.theme, + test!.theme ?? "", style: appStyle.fonts.B_16R.apply( color: appStyle.colors.textPrimary, ), diff --git a/kreta_api/lib/src/model/test.dart b/kreta_api/lib/src/model/test.dart index 00b3198..643d852 100644 --- a/kreta_api/lib/src/model/test.dart +++ b/kreta_api/lib/src/model/test.dart @@ -9,7 +9,7 @@ class Test extends UidObj { final int lessonNumber; final Subject subject; final String subjectName; - final String theme; + final String? theme; final NameUidDesc method; final UidObj classGroup;