diff --git a/frontend/lib/widgets/personal_info_form_screen.dart b/frontend/lib/widgets/personal_info_form_screen.dart index 4d56712..9881f57 100644 --- a/frontend/lib/widgets/personal_info_form_screen.dart +++ b/frontend/lib/widgets/personal_info_form_screen.dart @@ -182,29 +182,75 @@ class _PersonalInfoFormScreenState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - // Toggle "Il y a un 2ème parent" (uniquement pour Parent 2) + // Toggles "Ajouter Parent 2" et "Même Adresse" (uniquement pour Parent 2) if (widget.showSecondPersonToggle) ...[ Row( - mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - 'Il y a un 2ème parent ?', - style: GoogleFonts.merienda(fontSize: 20, fontWeight: FontWeight.w600), - ), - const SizedBox(width: 15), - Switch( - value: _hasSecondPerson, - onChanged: (value) { - setState(() { - _hasSecondPerson = value; - _fieldsEnabled = value; - }); - }, - activeColor: Theme.of(context).primaryColor, + Expanded( + flex: 12, + child: Row( + children: [ + const Icon(Icons.person_add_alt_1, size: 20), + const SizedBox(width: 8), + Flexible( + child: Text( + 'Ajouter Parent 2 ?', + style: GoogleFonts.merienda(fontWeight: FontWeight.bold), + overflow: TextOverflow.ellipsis, + ), + ), + const Spacer(), + Switch( + value: _hasSecondPerson, + onChanged: (value) { + setState(() { + _hasSecondPerson = value; + _fieldsEnabled = value; + }); + }, + activeColor: Theme.of(context).primaryColor, + ), + ], + ), ), + const Expanded(flex: 1, child: SizedBox()), + if (widget.showSameAddressCheckbox) + Expanded( + flex: 12, + child: Row( + children: [ + Icon( + Icons.home_work_outlined, + size: 20, + color: _fieldsEnabled ? null : Colors.grey, + ), + const SizedBox(width: 8), + Flexible( + child: Text( + 'Même Adresse ?', + style: GoogleFonts.merienda( + color: _fieldsEnabled ? null : Colors.grey, + ), + overflow: TextOverflow.ellipsis, + ), + ), + const Spacer(), + Switch( + value: _sameAddress, + onChanged: _fieldsEnabled ? (value) { + setState(() { + _sameAddress = value ?? false; + _updateAddressFields(); + }); + } : null, + activeColor: Theme.of(context).primaryColor, + ), + ], + ), + ), ], ), - const SizedBox(height: 25), + const SizedBox(height: 32), ], Row( children: [ @@ -272,24 +318,6 @@ class _PersonalInfoFormScreenState extends State { ], ), const SizedBox(height: 32), - - // Checkbox "Même adresse" (uniquement pour Parent 2) - if (widget.showSameAddressCheckbox) ...[ - AppCustomCheckbox( - label: 'Même adresse que le parent 1', - value: _sameAddress, - onChanged: (value) { - if (_fieldsEnabled) { - setState(() { - _sameAddress = value ?? false; - _updateAddressFields(); - }); - } - }, - ), - const SizedBox(height: 20), - ], - CustomAppTextField( controller: _addressController, labelText: 'Adresse (N° et Rue)',