added base homescreen-widget setup, working on Android, iOS in progress

This commit is contained in:
2026-05-09 18:01:05 +02:00
parent 0ff5eb7bc9
commit 00664c66a8
66 changed files with 5600 additions and 4 deletions
+6
View File
@@ -7,6 +7,7 @@ import '../../api/errors/error_mapper.dart';
import '../../api/marianumcloud/talk/room/get_room.dart';
import '../../api/marianumcloud/talk/room/get_room_params.dart';
import '../../model/account_data.dart';
import '../../widget_data/widget_sync.dart';
/// Owns the login flow's transient state (loading, last error) so it can be
/// driven from a thin Stateful view and unit-tested without a widget tree.
@@ -31,6 +32,11 @@ class LoginController extends ChangeNotifier {
final user = username.trim().toLowerCase();
try {
await AccountData().removeData();
// Drop any cached widget snapshot from a previous account before the
// new credentials populate it — otherwise a re-login with a different
// user briefly shows the previous owner's timetable on the home screen.
await WidgetSync.clear();
await WidgetSync.triggerUpdate();
await AccountData().setData(user, password);
await GetRoom(GetRoomParams(includeStatus: false)).run();
_loading = false;