forked from firka/firka
Áthúzással jelzés, hogy kész a házi
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import 'package:firka/helpers/api/model/homework.dart';
|
||||
import 'package:firka/helpers/db/models/homework_cache_model.dart';
|
||||
import 'package:firka/helpers/ui/common_bottom_sheets.dart';
|
||||
import 'package:firka/helpers/ui/firka_card.dart';
|
||||
import 'package:firka/main.dart';
|
||||
import 'package:firka/ui/model/style.dart';
|
||||
@@ -19,11 +21,27 @@ class HomeworkWidget extends StatelessWidget {
|
||||
left: [
|
||||
Row(
|
||||
children: [
|
||||
FirkaIconWidget(
|
||||
FirkaIconType.majesticons,
|
||||
Majesticon.homeSolid,
|
||||
color: appStyle.colors.accent,
|
||||
size: 24,
|
||||
FutureBuilder<bool>(
|
||||
future: isHomeworkDone(data.isar, item.uid),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return SizedBox();
|
||||
}
|
||||
final done = snapshot.data!;
|
||||
return done
|
||||
? FirkaIconWidget(
|
||||
FirkaIconType.majesticonsLocal,
|
||||
"homeWithMark",
|
||||
color: appStyle.colors.accent,
|
||||
size: 24,
|
||||
)
|
||||
: FirkaIconWidget(
|
||||
FirkaIconType.majesticons,
|
||||
Majesticon.homeSolid,
|
||||
color: appStyle.colors.accent,
|
||||
size: 24,
|
||||
);
|
||||
}
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
@@ -31,20 +49,36 @@ class HomeworkWidget extends StatelessWidget {
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(data.l10n.homework,
|
||||
style: appStyle.fonts.B_16SB
|
||||
.apply(color: appStyle.colors.textPrimary)),
|
||||
Text(item.subjectName,
|
||||
FutureBuilder<bool>(
|
||||
future: isHomeworkDone(data.isar, item.uid),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return SizedBox();
|
||||
}
|
||||
final done = snapshot.data!;
|
||||
return done
|
||||
? Text(data.l10n.homework,
|
||||
style: appStyle.fonts.B_16SB
|
||||
.apply(color: appStyle.colors.textPrimary, decoration: TextDecoration.lineThrough))
|
||||
: Text(data.l10n.homework,
|
||||
style: appStyle.fonts.B_16SB
|
||||
.apply(color: appStyle.colors.textPrimary));
|
||||
},
|
||||
),
|
||||
Text(
|
||||
item.subjectName,
|
||||
style: appStyle.fonts.B_16R
|
||||
.apply(color: appStyle.colors.textPrimary))
|
||||
],
|
||||
.apply(color: appStyle.colors.textPrimary),
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
// showGradeBottomSheet(context, widget.data, grade);
|
||||
showHomeworkBottomSheet(context, data, item);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user