Fix white screen after login: pushReplacement to DashboardScreen; main decides home by email presence; add missing imports

This commit is contained in:
cania
2026-08-12 12:38:44 +02:00
parent 4c681914f5
commit 761d746a83
3 changed files with 24 additions and 11 deletions

View File

@@ -30,6 +30,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Provider.of<ThemeProvider>(context);
final auth = Provider.of<AuthService>(context, listen: false);
return MaterialApp(
title: 'Login Vault',
theme: ThemeData(
@@ -43,13 +44,10 @@ class MyApp extends StatelessWidget {
colorSchemeSeed: Colors.indigo,
),
themeMode: theme.mode,
home: registered
? DashboardScreen(
auth: context.read<AuthService>(),
theme: theme,
email: email,
)
: AuthScreen(auth: context.read<AuthService>()),
// decide home: if registered AND email known -> Dashboard, else Auth.
home: (registered && email.isNotEmpty)
? DashboardScreen(auth: auth, theme: theme, email: email)
: AuthScreen(auth: auth),
debugShowCheckedModeBanner: false,
);
}