forked from firka/firka
tmp fix: themeless tests
This commit is contained in:
@@ -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),
|
||||
);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user