Implémentation du parcours d'inscription des assistantes maternelles en 4 étapes + écran de confirmation, en utilisant Provider pour la gestion d'état. Fonctionnalités implémentées : - Étape 1 : Identité (nom, prénom, adresse, email, mot de passe) - Étape 2 : Infos professionnelles (photo, agrément, NIR, capacité d'accueil) - Étape 3 : Présentation personnelle et acceptation CGU - Étape 4 : Récapitulatif et validation finale - Écran de confirmation post-inscription Fichiers ajoutés : - models/nanny_registration_data.dart : Modèle de données avec Provider - screens/auth/nanny_register_step1_screen.dart : Identité - screens/auth/nanny_register_step2_screen.dart : Infos pro - screens/auth/nanny_register_step3_screen.dart : Présentation - screens/auth/nanny_register_step4_screen.dart : Récapitulatif - screens/auth/nanny_register_confirmation_screen.dart : Confirmation - screens/unknown_screen.dart : Écran pour routes inconnues - config/app_router.dart : Copie du routeur (à intégrer) Refs: #40 (Panneau 1 Identité), #41 (Panneau 2 Infos pro), #42 (Finalisation)
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
// Models
|
||||
import '../models/user_registration_data.dart';
|
||||
import '../models/nanny_registration_data.dart';
|
||||
|
||||
// Screens
|
||||
import '../screens/auth/login_screen.dart';
|
||||
import '../screens/auth/register_choice_screen.dart';
|
||||
import '../screens/auth/parent_register_step1_screen.dart';
|
||||
import '../screens/auth/parent_register_step2_screen.dart';
|
||||
import '../screens/auth/parent_register_step3_screen.dart';
|
||||
import '../screens/auth/parent_register_step4_screen.dart';
|
||||
import '../screens/auth/parent_register_step5_screen.dart';
|
||||
import '../screens/auth/nanny_register_step1_screen.dart';
|
||||
import '../screens/auth/nanny_register_step2_screen.dart';
|
||||
import '../screens/auth/nanny_register_step3_screen.dart';
|
||||
import '../screens/auth/nanny_register_step4_screen.dart';
|
||||
import '../screens/auth/nanny_register_confirmation_screen.dart';
|
||||
import '../screens/home/home_screen.dart';
|
||||
import '../screens/unknown_screen.dart';
|
||||
|
||||
// --- Provider Instances ---
|
||||
// It's generally better to provide these higher up the widget tree if possible,
|
||||
// or ensure they are created only once.
|
||||
// For ShellRoute, creating them here and passing via .value is common.
|
||||
|
||||
final userRegistrationDataNotifier = UserRegistrationData();
|
||||
final nannyRegistrationDataNotifier = NannyRegistrationData();
|
||||
|
||||
class AppRouter {
|
||||
static final GoRouter router = GoRouter(
|
||||
initialLocation: '/login',
|
||||
errorBuilder: (context, state) => const UnknownScreen(),
|
||||
debugLogDiagnostics: true,
|
||||
routes: <RouteBase>[
|
||||
GoRoute(
|
||||
path: '/login',
|
||||
builder: (BuildContext context, GoRouterState state) => const LoginScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/register-choice',
|
||||
builder: (BuildContext context, GoRouterState state) => const RegisterChoiceScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/home',
|
||||
builder: (BuildContext context, GoRouterState state) => const HomeScreen(),
|
||||
),
|
||||
|
||||
// --- Parent Registration Flow ---
|
||||
ShellRoute(
|
||||
builder: (context, state, child) {
|
||||
return ChangeNotifierProvider<UserRegistrationData>.value(
|
||||
value: userRegistrationDataNotifier,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
routes: <RouteBase>[
|
||||
GoRoute(
|
||||
path: '/parent-register-step1',
|
||||
builder: (BuildContext context, GoRouterState state) => const ParentRegisterStep1Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/parent-register-step2',
|
||||
builder: (BuildContext context, GoRouterState state) => const ParentRegisterStep2Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/parent-register-step3',
|
||||
builder: (BuildContext context, GoRouterState state) => const ParentRegisterStep3Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/parent-register-step4',
|
||||
builder: (BuildContext context, GoRouterState state) => const ParentRegisterStep4Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/parent-register-step5',
|
||||
builder: (BuildContext context, GoRouterState state) => const ParentRegisterStep5Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/parent-register-confirmation',
|
||||
builder: (BuildContext context, GoRouterState state) => const NannyRegisterConfirmationScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// --- Nanny Registration Flow ---
|
||||
ShellRoute(
|
||||
builder: (context, state, child) {
|
||||
return ChangeNotifierProvider<NannyRegistrationData>.value(
|
||||
value: nannyRegistrationDataNotifier,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
routes: <RouteBase>[
|
||||
GoRoute(
|
||||
path: '/nanny-register-step1',
|
||||
builder: (BuildContext context, GoRouterState state) => const NannyRegisterStep1Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/nanny-register-step2',
|
||||
builder: (BuildContext context, GoRouterState state) => const NannyRegisterStep2Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/nanny-register-step3',
|
||||
builder: (BuildContext context, GoRouterState state) => const NannyRegisterStep3Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/nanny-register-step4',
|
||||
builder: (BuildContext context, GoRouterState state) => const NannyRegisterStep4Screen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/nanny-register-confirmation',
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
return const NannyRegisterConfirmationScreen();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user