Órarend fix: Szünetek megjelenítése

This commit is contained in:
2025-10-12 17:26:57 +02:00
committed by 4831c0
parent ae79a44df9
commit a000481cd9
4 changed files with 13 additions and 5 deletions

View File

@@ -579,6 +579,7 @@ Future<void> showGradeBottomSheet(
LessonWidget(
data,
[],
[],
-1,
Lesson(
uid: "-1",

View File

@@ -401,6 +401,11 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
lesson.start.isAfter(date) &&
lesson.end.isBefore(date.add(Duration(hours: 24))))
.toList();
final lessonsOnDay = lessons!
.where((lesson) =>
lesson.start.getMidnight().millisecondsSinceEpoch ==
date.getMidnight().millisecondsSinceEpoch)
.toList();
final eventsOnDate = events!
.where((lesson) =>
lesson.start.isAfter(date.subtract(Duration(seconds: 1))) &&
@@ -413,7 +418,7 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
.toList();
ttDays.add(TimeTableDayWidget(widget.data, date, lessons!,
lessonsOnDate, eventsOnDate, testsOnDate));
lessonsOnDate, eventsOnDate, testsOnDate, lessonsOnDay));
}
List<Widget> ttEmptyCards = List.empty(growable: true);

View File

@@ -18,13 +18,14 @@ import 'bubble_test.dart';
class LessonWidget extends StatelessWidget {
final AppInitialization data;
final List<Lesson> week;
final List<Lesson> day;
final int? lessonNo;
final Lesson lesson;
final Test? test;
final Lesson? nextLesson;
final bool? placeholderMode;
const LessonWidget(this.data, this.week, this.lessonNo, this.lesson,
const LessonWidget(this.data, this.week, this.day, this.lessonNo, this.lesson,
this.test, this.nextLesson,
{super.key, this.placeholderMode});
@@ -46,9 +47,8 @@ class LessonWidget extends StatelessWidget {
showBreak =
timeNow().isAfter(lesson.start) && timeNow().isBefore(lesson.end) ||
timeNow().isAfter(week.last.end) ||
lesson.start.getMidnight() != timeNow().getMidnight();
lesson.start.getMidnight() != timeNow().getMidnight() || timeNow().isAfter(day.last.end);
}
var accent = appStyle.colors.accent;
var secondary = appStyle.colors.secondary;
var bgColor = appStyle.colors.a15p;

View File

@@ -16,9 +16,10 @@ class TimeTableDayWidget extends StatelessWidget {
final List<Lesson> lessons;
final List<Lesson> events;
final List<Test> tests;
final List<Lesson> day;
const TimeTableDayWidget(
this.data, this.date, this.week, this.lessons, this.events, this.tests,
this.data, this.date, this.week, this.lessons, this.events, this.tests, this.day,
{super.key});
@override
@@ -63,6 +64,7 @@ class TimeTableDayWidget extends StatelessWidget {
ttBody.add(LessonWidget(
data,
week,
day,
lessons.getLessonNo(lesson),
lesson,
tests.firstWhereOrNull(