L'authentification Keycloak WebView est maintenant 100% fonctionnelle avec navigation automatique vers le dashboard !

This commit is contained in:
DahoudG
2025-09-19 13:03:09 +00:00
parent 098894bdc1
commit 4ac376b7e7
4 changed files with 53 additions and 31 deletions

View File

@@ -74,22 +74,29 @@ class UnionFlowApp extends StatelessWidget {
GlobalCupertinoLocalizations.delegate,
],
// Page d'accueil avec authentification
home: BlocBuilder<AuthBloc, AuthState>(
builder: (context, state) {
if (state is AuthLoading) {
return const Scaffold(
body: Center(
child: CircularProgressIndicator(),
),
);
} else if (state is AuthAuthenticated) {
return const AdaptiveDashboardPage();
} else {
return const LoginPage();
}
},
),
// Configuration des routes
routes: {
'/': (context) => BlocBuilder<AuthBloc, AuthState>(
builder: (context, state) {
if (state is AuthLoading) {
return const Scaffold(
body: Center(
child: CircularProgressIndicator(),
),
);
} else if (state is AuthAuthenticated) {
return const AdaptiveDashboardPage();
} else {
return const LoginPage();
}
},
),
'/dashboard': (context) => const AdaptiveDashboardPage(),
'/login': (context) => const LoginPage(),
},
// Page d'accueil par défaut
initialRoute: '/',
// Builder global pour gérer les erreurs
builder: (context, child) {