1
0
forked from firka/firka

tt/mo: add lesson count

This commit is contained in:
2025-08-24 14:47:41 +02:00
parent 46fdc834a5
commit b850551a6d
2 changed files with 76 additions and 6 deletions

View File

@@ -33,7 +33,17 @@ extension DurationExtension on Duration {
}
}
enum FormatMode { yearly, grades, welcome, hmm, da, dd, yyyymmddwedd, yyyymmmm }
enum FormatMode {
yearly,
grades,
welcome,
hmm,
d,
da,
dd,
yyyymmddwedd,
yyyymmmm
}
enum Cycle { morning, day, afternoon, night }
@@ -75,6 +85,8 @@ extension DateExtension on DateTime {
return DateFormat('H:mm').format(this);
case FormatMode.welcome:
return DateFormat('EEE, MMM d').format(this);
case FormatMode.d:
return DateFormat('d').format(this);
case FormatMode.da:
return DateFormat('MMMMEEEEd').format(this).substring(0, 2);
case FormatMode.dd:

View File

@@ -1,4 +1,3 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:firka/helpers/api/model/timetable.dart';
import 'package:firka/helpers/debug_helper.dart';
import 'package:firka/helpers/extensions.dart';
@@ -121,8 +120,11 @@ class _HomeTimetableMonthlyScreen extends State<HomeTimetableMonthlyScreen> {
if (lessonsToday.isNotEmpty) {
body = Center(
child: Text(lessonsToday.length.toString(),
style: appStyle.fonts.H_16px
.apply(color: appStyle.colors.secondary)),
style: appStyle.fonts.H_16px.apply(
color:
timeNow().day == d.day && timeNow().month == d.month
? appStyle.colors.accent
: appStyle.colors.secondary)),
);
}
ttDays.add(Column(
@@ -132,14 +134,16 @@ class _HomeTimetableMonthlyScreen extends State<HomeTimetableMonthlyScreen> {
height: 40,
clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration(
color: appStyle.colors.card,
color: timeNow().day == d.day && timeNow().month == d.month
? appStyle.colors.buttonSecondaryFill
: appStyle.colors.card,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6)),
),
child: body,
),
SizedBox(height: 4),
Text(d.format(widget.data.l10n, FormatMode.dd),
Text(d.format(widget.data.l10n, FormatMode.d),
style: appStyle.fonts.B_14R.apply(
color: (d.weekday == DateTime.saturday ||
d.weekday == DateTime.sunday) &&
@@ -290,6 +294,60 @@ class _HomeTimetableMonthlyScreen extends State<HomeTimetableMonthlyScreen> {
),
)),
)),
TransparentPointer(
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height / 1.3,
),
SizedBox(
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(),
Row(
children: [
Container(
clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration(
color: appStyle.colors.buttonSecondaryFill,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16)),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 4),
child: Row(
children: [
FirkaIconWidget(FirkaIconType.majesticons,
Majesticon.clockSolid,
color: appStyle.colors.accent, size: 16),
SizedBox(width: 6),
Text(
lessons!
.where((lesson) =>
lesson.start
.isAfter(currentMonthStart) &&
lesson.end
.isBefore(currentMonthEnd))
.length
.toString(),
style: appStyle.fonts.H_16px.apply(
color: appStyle.colors.textPrimary))
],
),
),
),
],
),
SizedBox()
],
),
)
],
),
),
]);
} else {
return SizedBox(