feat(#14): finalisation redirection et nettoyage

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-15 23:08:02 +01:00
co-authored by Cursor
parent 31857ec891
commit 8e8c6d79b1
3 changed files with 40 additions and 31 deletions
@@ -15,13 +15,8 @@ class AdminDashboardScreen extends StatefulWidget {
}
class _AdminDashboardScreenState extends State<AdminDashboardScreen> {
/// null = chargement du statut setup, true/false = connu
bool? _setupCompleted;
/// 0 = Gestion des utilisateurs, 1 = Paramètres
int mainTabIndex = 0;
/// Sous-onglet quand mainTabIndex == 0 : 0=Gestionnaires, 1=Parents, 2=AM, 3=Administrateurs
int subIndex = 0;
@override
@@ -38,8 +33,11 @@ class _AdminDashboardScreenState extends State<AdminDashboardScreen> {
_setupCompleted = completed;
if (!completed) mainTabIndex = 1;
});
} catch (_) {
if (mounted) setState(() => _setupCompleted = true);
} catch (e) {
if (mounted) setState(() {
_setupCompleted = false;
mainTabIndex = 1;
});
}
}
@@ -96,9 +94,7 @@ class _AdminDashboardScreenState extends State<AdminDashboardScreen> {
Widget _getBody() {
if (mainTabIndex == 1) {
return ParametresPanel(
onSetupCompleted: () => setState(() => _setupCompleted = true),
);
return ParametresPanel(redirectToLoginAfterSave: !_setupCompleted!);
}
switch (subIndex) {
case 0: