From f09deb5efce2a53fd6b8841c9ae4e1d6941c5fe2 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Wed, 28 Jan 2026 16:47:10 +0100 Subject: [PATCH] fix(auth): Correction des erreurs de compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../screens/auth/am_register_step1_screen.dart | 3 +-- .../auth/parent_register_step1_screen.dart | 4 ++-- .../auth/parent_register_step2_screen.dart | 6 +++--- .../lib/widgets/personal_info_form_screen.dart | 16 +++++++++------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/frontend/lib/screens/auth/am_register_step1_screen.dart b/frontend/lib/screens/auth/am_register_step1_screen.dart index f28c83e..06a8fa2 100644 --- a/frontend/lib/screens/auth/am_register_step1_screen.dart +++ b/frontend/lib/screens/auth/am_register_step1_screen.dart @@ -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'); }, diff --git a/frontend/lib/screens/auth/parent_register_step1_screen.dart b/frontend/lib/screens/auth/parent_register_step1_screen.dart index d77f239..bfabab3 100644 --- a/frontend/lib/screens/auth/parent_register_step1_screen.dart +++ b/frontend/lib/screens/auth/parent_register_step1_screen.dart @@ -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'); }, ); diff --git a/frontend/lib/screens/auth/parent_register_step2_screen.dart b/frontend/lib/screens/auth/parent_register_step2_screen.dart index f4a7673..efa3277 100644 --- a/frontend/lib/screens/auth/parent_register_step2_screen.dart +++ b/frontend/lib/screens/auth/parent_register_step2_screen.dart @@ -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'); }, diff --git a/frontend/lib/widgets/personal_info_form_screen.dart b/frontend/lib/widgets/personal_info_form_screen.dart index 5a90d57..50b3cb2 100644 --- a/frontend/lib/widgets/personal_info_form_screen.dart +++ b/frontend/lib/widgets/personal_info_form_screen.dart @@ -155,7 +155,7 @@ class _PersonalInfoFormScreenState extends State { 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 { AppCustomCheckbox( label: 'Même adresse que le parent 1', value: _sameAddress, - onChanged: _fieldsEnabled ? (value) { - setState(() { - _sameAddress = value ?? false; - _updateAddressFields(); - }); - } : null, + onChanged: (value) { + if (_fieldsEnabled) { + setState(() { + _sameAddress = value ?? false; + _updateAddressFields(); + }); + } + }, ), const SizedBox(height: 20), ],