tmp fix: themeless tests

This commit is contained in:
checkedear
2026-06-09 00:50:01 +02:00
parent 3a2cdfce05
commit 1d912abc7d
4 changed files with 12 additions and 5 deletions

View File

@@ -56,13 +56,20 @@ class InfoCard extends StatelessWidget {
size: 24, 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)], right: [buildSubject(color, test.subject)],
onTap: (context) => showTestBottomSheet(context, initData, test), onTap: (context) => showTestBottomSheet(context, initData, test),
); );
} }
factory InfoCard.testDesc(Test test) { factory InfoCard.testDesc(Test test) {
if (test.theme == null) {
return InfoCard.test(test);
}
final color = appStyle.colors.accent; final color = appStyle.colors.accent;
return InfoCard( return InfoCard(
@@ -76,7 +83,7 @@ class InfoCard extends StatelessWidget {
size: 24, size: 24,
), ),
), ),
texts: [test.theme.firstUpper(), test.method.description.firstUpper()], texts: [test.theme!.firstUpper(), test.method.description.firstUpper()],
right: [buildSubject(color, test.subject)], right: [buildSubject(color, test.subject)],
onTap: (context) => showTestBottomSheet(context, initData, test), onTap: (context) => showTestBottomSheet(context, initData, test),
); );

View File

@@ -244,7 +244,7 @@ class LessonWidget extends StatelessWidget {
); );
if (test != null && showTests) { if (test != null && showTests) {
var theme = test!.theme.firstUpper(); var theme = test!.theme?.firstUpper() ?? "";
var method = test!.method.description.firstUpper(); var method = test!.method.description.firstUpper();
elements.add( elements.add(

View File

@@ -112,7 +112,7 @@ class LessonBigWidget extends StatelessWidget {
SizedBox(width: 8), SizedBox(width: 8),
Expanded( Expanded(
child: Text( child: Text(
test!.theme, test!.theme ?? "",
style: appStyle.fonts.B_16R.apply( style: appStyle.fonts.B_16R.apply(
color: appStyle.colors.textPrimary, color: appStyle.colors.textPrimary,
), ),

View File

@@ -9,7 +9,7 @@ class Test extends UidObj {
final int lessonNumber; final int lessonNumber;
final Subject subject; final Subject subject;
final String subjectName; final String subjectName;
final String theme; final String? theme;
final NameUidDesc method; final NameUidDesc method;
final UidObj classGroup; final UidObj classGroup;