custom login implementation, period-based timetable layout with overlap handling, enhanced error dialogs, and unified bottom sheets
This commit is contained in:
+22
-8
@@ -159,6 +159,15 @@ class _MainState extends State<Main> {
|
||||
themeMode: settings.appTheme,
|
||||
theme: LightAppTheme.theme,
|
||||
darkTheme: DarkAppTheme.theme,
|
||||
// Brand-colored backdrop behind every route. During the logout
|
||||
// home-swap and route pop animations the framework can briefly
|
||||
// expose the layer below the topmost Scaffold; without this
|
||||
// the dark Material default shows through and the user sees a
|
||||
// black flash.
|
||||
builder: (context, child) => ColoredBox(
|
||||
color: LightAppTheme.marianumRed,
|
||||
child: child ?? const SizedBox.shrink(),
|
||||
),
|
||||
home: LoaderOverlay(
|
||||
child: Breaker(
|
||||
breaker: BreakerArea.global,
|
||||
@@ -203,14 +212,16 @@ class _MainState extends State<Main> {
|
||||
case AccountStatus.loggedOut:
|
||||
return const Login();
|
||||
case AccountStatus.undefined:
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
return Scaffold(
|
||||
backgroundColor: LightAppTheme.marianumRed,
|
||||
body: const Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppProgressIndicator.large(),
|
||||
AppProgressIndicator.large(color: Colors.white),
|
||||
SizedBox(height: 16),
|
||||
Text('Konto wird geladen…'),
|
||||
Text('Konto wird geladen…',
|
||||
style: TextStyle(color: Colors.white)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -234,16 +245,19 @@ Future<void> _wipeUserState({
|
||||
required BreakerBloc breakerBloc,
|
||||
}) async {
|
||||
try {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.clear();
|
||||
PaintingBinding.instance.imageCache.clear();
|
||||
await settingsCubit.reset();
|
||||
// Reset user-data blocs whose tree is no longer mounted after the
|
||||
// home swap. We do NOT touch SettingsCubit here — its outer BlocBuilder
|
||||
// wraps MaterialApp, so emit'ing a fresh state would tear down the
|
||||
// freshly-mounted Login tree and leave the user with a blank screen
|
||||
// (the MaterialApp.builder backdrop) until the next interaction.
|
||||
await Future.wait([
|
||||
timetableBloc.reset(),
|
||||
chatListBloc.reset(),
|
||||
chatBloc.reset(),
|
||||
breakerBloc.reset(),
|
||||
]);
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.clear();
|
||||
await HydratedBloc.storage.clear();
|
||||
await const CacheView().clear();
|
||||
} catch (e, s) {
|
||||
|
||||
Reference in New Issue
Block a user