migrated custom timetable events to Marianum-Connect and refactored push notification handling

This commit is contained in:
2026-07-12 14:31:48 +02:00
parent c444ed54a5
commit 91a6216f66
28 changed files with 474 additions and 212 deletions
@@ -57,6 +57,10 @@ class _CustomEventEditDialogState extends State<CustomEventEditDialog> {
text: widget.existingEvent?.description ?? widget.initialDescription,
);
late String _rrule = widget.existingEvent?.rrule ?? '';
// Für neue Termine standardmäßig an, bestehende behalten ihren Wert. Migrierte
// mhsl-Termine tragen ausgeschaltet (Modell-Default), da sie nie ein Serien-
// Ferien-Flag hatten.
late bool _skipHolidays = widget.existingEvent?.skipHolidays ?? true;
late CustomTimetableColors _color = CustomTimetableColors.values.firstWhere(
(e) => e.name == widget.existingEvent?.color,
orElse: () => TimetableColors.defaultColor,
@@ -150,6 +154,7 @@ class _CustomEventEditDialogState extends State<CustomEventEditDialog> {
endDate: endDate,
color: _color.name,
rrule: _rrule,
skipHolidays: _rrule.trim().isEmpty ? false : _skipHolidays,
createdAt: DateTime.now(),
updatedAt: DateTime.now(),
);
@@ -297,6 +302,18 @@ class _CustomEventEditDialogState extends State<CustomEventEditDialog> {
},
),
),
if (_rrule.trim().isNotEmpty) ...[
const Divider(),
SwitchListTile(
secondary: const Icon(Icons.beach_access_outlined),
title: const Text('In den Ferien ausblenden'),
subtitle: const Text(
'An Ferientagen wird der Termin nicht angezeigt',
),
value: _skipHolidays,
onChanged: (v) => setState(() => _skipHolidays = v),
),
],
],
),
),