Étapes 1 à 3 du formulaire d'inscription AM : remplacer les données aléatoires par le jeu de test officiel (03_seed_test_data.sql). Made-with: Cursor
43 lines
1.5 KiB
Dart
43 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import '../../models/am_registration_data.dart';
|
|
import '../../widgets/presentation_form_screen.dart';
|
|
import '../../models/card_assets.dart';
|
|
|
|
class AmRegisterStep3Screen extends StatelessWidget {
|
|
const AmRegisterStep3Screen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final data = Provider.of<AmRegistrationData>(context, listen: false);
|
|
|
|
// Données de test : Marie DUBOIS (jeu de test 03_seed_test_data.sql / docs/test-data)
|
|
String initialText = data.presentationText;
|
|
bool initialCgu = data.cguAccepted;
|
|
|
|
if (initialText.isEmpty) {
|
|
initialText = 'Assistante maternelle agréée depuis 2019. Spécialité bébés 0-18 mois. Accueil bienveillant et cadre sécurisant. 2 places disponibles.';
|
|
initialCgu = true;
|
|
}
|
|
|
|
return PresentationFormScreen(
|
|
stepText: 'Étape 3/4',
|
|
title: 'Présentation et Conditions',
|
|
cardColor: CardColorHorizontal.peach,
|
|
textFieldHint: 'Ex: Disponible immédiatement, 10 ans d\'expérience, formation premiers secours...',
|
|
initialText: initialText,
|
|
initialCguAccepted: initialCgu,
|
|
previousRoute: '/am-register-step2',
|
|
onSubmit: (text, cguAccepted) {
|
|
data.updatePresentationAndCgu(
|
|
presentationText: text,
|
|
cguAccepted: cguAccepted,
|
|
);
|
|
context.go('/am-register-step4');
|
|
},
|
|
);
|
|
}
|
|
}
|