show classname instead of teacher name in teacher timetable view

This commit is contained in:
2026-08-09 12:19:57 +02:00
parent 39c16bd4ea
commit 889d8f67c5
21 changed files with 292 additions and 81 deletions
+22 -14
View File
@@ -31,6 +31,9 @@ class WidgetSync {
static const String connectDoubleLessonsKey =
'widget_setting_connect_double_lessons_v1';
static const String themeModeKey = 'widget_setting_theme_mode_v1';
// Mirrored from CapabilitiesCubit so the background isolate can render
// teacher plans (class instead of teacher name) without bloc storage.
static const String isTeacherKey = 'widget_setting_is_teacher_v1';
// Mirrored so the background isolate hits the same Marianum-Connect base
// URL the in-app settings cubit currently has selected.
static const String marianumConnectBaseUrlKey = 'widget_setting_mc_base_url_v1';
@@ -58,25 +61,30 @@ class WidgetSync {
);
}
static Future<void> setLoggedIn(bool loggedIn) async {
await ensureInitialized();
await HomeWidget.saveWidgetData<bool>(loggedInKey, loggedIn);
}
static Future<void> setLoggedIn(bool loggedIn) =>
_setBool(loggedInKey, loggedIn);
static Future<void> setConnectDoubleLessons(bool value) async {
await ensureInitialized();
await HomeWidget.saveWidgetData<bool>(connectDoubleLessonsKey, value);
}
static Future<void> setConnectDoubleLessons(bool value) =>
_setBool(connectDoubleLessonsKey, value);
/// Default `true` matches `default_settings.dart` — fresh install behaves
/// like the in-app calendar.
static Future<bool> getConnectDoubleLessons() async {
static Future<bool> getConnectDoubleLessons() =>
_getBool(connectDoubleLessonsKey, defaultValue: true);
static Future<void> setIsTeacher(bool value) => _setBool(isTeacherKey, value);
static Future<bool> getIsTeacher() =>
_getBool(isTeacherKey, defaultValue: false);
static Future<void> _setBool(String key, bool value) async {
await ensureInitialized();
final value = await HomeWidget.getWidgetData<bool>(
connectDoubleLessonsKey,
defaultValue: true,
);
return value ?? true;
await HomeWidget.saveWidgetData<bool>(key, value);
}
static Future<bool> _getBool(String key, {required bool defaultValue}) async {
await ensureInitialized();
return await HomeWidget.getWidgetData<bool>(key) ?? defaultValue;
}
static Future<void> setThemeMode(String mode) async {