fix(auth): Correction des erreurs de compilation

Corrections des appels de méthodes et des types :

1. Parent Steps 1-2 : Passer des objets ParentData complets
   - updateParent1(ParentData(...)) au lieu de paramètres nommés
   - updateParent2(ParentData(...)) ou null pour supprimer

2. AM Step 1 : Utiliser la bonne méthode
   - updateIdentityInfo() au lieu de updatePersonalInfo()

3. personal_info_form_screen : Corrections widgets
   - Accès correct à widget.stepText
   - Gestion du nullable sur onChanged de AppCustomCheckbox

Ces corrections permettent la compilation sans erreur.
This commit is contained in:
MARTIN Julien 2026-01-28 16:47:10 +01:00
parent 26a0e31b32
commit f09deb5efc
4 changed files with 15 additions and 14 deletions

View File

@ -47,7 +47,7 @@ class AmRegisterStep1Screen extends StatelessWidget {
initialData: initialData,
previousRoute: '/register-choice',
onSubmit: (data, {hasSecondPerson, sameAddress}) {
registrationData.updatePersonalInfo(
registrationData.updateIdentityInfo(
firstName: data.firstName,
lastName: data.lastName,
phone: data.phone,
@ -56,7 +56,6 @@ class AmRegisterStep1Screen extends StatelessWidget {
postalCode: data.postalCode,
city: data.city,
password: '',
photoConsent: false,
);
context.go('/am-register-step2');
},

View File

@ -48,7 +48,7 @@ class ParentRegisterStep1Screen extends StatelessWidget {
initialData: initialData,
previousRoute: '/register-choice',
onSubmit: (data, {hasSecondPerson, sameAddress}) {
registrationData.updateParent1(
registrationData.updateParent1(ParentData(
firstName: data.firstName,
lastName: data.lastName,
phone: data.phone,
@ -57,7 +57,7 @@ class ParentRegisterStep1Screen extends StatelessWidget {
postalCode: data.postalCode,
city: data.city,
password: '',
);
));
context.go('/parent-register-step2');
},
);

View File

@ -70,7 +70,7 @@ class ParentRegisterStep2Screen extends StatelessWidget {
referenceAddressData: referenceAddress,
onSubmit: (data, {hasSecondPerson, sameAddress}) {
if (hasSecondPerson == true) {
registrationData.updateParent2(
registrationData.updateParent2(ParentData(
firstName: data.firstName,
lastName: data.lastName,
phone: data.phone,
@ -79,9 +79,9 @@ class ParentRegisterStep2Screen extends StatelessWidget {
postalCode: data.postalCode,
city: data.city,
password: '',
);
));
} else {
registrationData.removeParent2();
registrationData.updateParent2(null);
}
context.go('/parent-register-step3');
},

View File

@ -155,7 +155,7 @@ class _PersonalInfoFormScreenState extends State<PersonalInfoFormScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(stepText, style: GoogleFonts.merienda(fontSize: 16, color: Colors.black54)),
Text(widget.stepText, style: GoogleFonts.merienda(fontSize: 16, color: Colors.black54)),
const SizedBox(height: 10),
Text(
widget.title,
@ -283,12 +283,14 @@ class _PersonalInfoFormScreenState extends State<PersonalInfoFormScreen> {
AppCustomCheckbox(
label: 'Même adresse que le parent 1',
value: _sameAddress,
onChanged: _fieldsEnabled ? (value) {
onChanged: (value) {
if (_fieldsEnabled) {
setState(() {
_sameAddress = value ?? false;
_updateAddressFields();
});
} : null,
}
},
),
const SizedBox(height: 20),
],