implemented current schoolyear API and dynamic timetable scroll boundaries, added handling for out-of-range errors to narrow accessible dates, optimized holiday region rendering by collapsing overlaps, and refined holiday tile UI

This commit is contained in:
2026-05-14 15:07:48 +02:00
parent 2cb8321d07
commit 582eff8750
13 changed files with 368 additions and 51 deletions
@@ -1,6 +1,7 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import '../../../../../api/mhsl/custom_timetable_event/get/get_custom_timetable_event_response.dart';
import '../../../../../api/webuntis/queries/get_current_schoolyear/get_current_schoolyear_response.dart';
import '../../../../../api/webuntis/queries/get_holidays/get_holidays_response.dart';
import '../../../../../api/webuntis/queries/get_rooms/get_rooms_response.dart';
import '../../../../../api/webuntis/queries/get_subjects/get_subjects_response.dart';
@@ -20,11 +21,18 @@ abstract class TimetableState with _$TimetableState {
GetRoomsResponse? rooms,
GetSubjectsResponse? subjects,
GetHolidaysResponse? schoolHolidays,
GetCurrentSchoolyearResponse? schoolyear,
GetTimegridUnitsResponse? timegrid,
GetCustomTimetableEventResponse? customEvents,
required DateTime startDate,
required DateTime endDate,
@Default(0) int dataVersion,
// Boundaries learned from `-7004 no allowed date` errors during scroll.
// Inclusive: weeks whose start is on/before `accessibleEndDate` and
// whose end is on/after `accessibleStartDate` are within the user's
// permitted range. Null = no upper / lower bound discovered yet.
DateTime? accessibleStartDate,
DateTime? accessibleEndDate,
}) = _TimetableState;
factory TimetableState.fromJson(Map<String, Object?> json) =>