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