From 20dcb385c197da519af2cd8e5b05264c32ea8a54 Mon Sep 17 00:00:00 2001 From: Varadraj75 Date: Wed, 8 Apr 2026 03:03:56 +0530 Subject: [PATCH 1/2] fix: correct field mapping in child mode onboarding for phone, country and guardian relation --- .../auth/personal_details_screen.dart | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/patient/lib/presentation/auth/personal_details_screen.dart b/patient/lib/presentation/auth/personal_details_screen.dart index 0aa9da1..87a9f75 100644 --- a/patient/lib/presentation/auth/personal_details_screen.dart +++ b/patient/lib/presentation/auth/personal_details_screen.dart @@ -91,11 +91,13 @@ class _PersonalDetailsScreenState extends State { : adultNameController.text, age: isAssessmentForChild ? parseAge(childAgeController.text) : parseAge(adultAgeController.text), isAdult: isAssessmentForChild ? isAdult(childAgeController.text) : isAdult(adultAgeController.text), - phoneNo: phoneController.text, + phoneNo: isAssessmentForChild ? guardianPhoneController.text : phoneController.text, email: '', guardianName: isAssessmentForChild ? adultNameController.text : '', - guardianRelation: isAssessmentForChild ? guardianPhoneController.text : phoneController.text, - country: selectedCountry?.displayName ?? '', + guardianRelation: isAssessmentForChild ? selectedRelation : '', + country: isAssessmentForChild + ? selectedChildCountry?.displayName ?? '' + : selectedCountry?.displayName ?? '', gender: isAssessmentForChild ? selectedChildGender ?? '' : selectedGender ?? '', ); } @@ -110,6 +112,18 @@ class _PersonalDetailsScreenState extends State { onPressed: () { if (_formKey.currentState?.validate() ?? false) { + if (isAssessmentForChild && selectedRelation.isEmpty) { + setState(() { + _validationErrors['relation'] = 'Please select your relation with the patient'; + }); + return; + } + if (isAssessmentForChild && (selectedChildGender == null || selectedChildGender!.isEmpty)) { + setState(() { + _validationErrors['gender'] = 'Please select patient gender'; + }); + return; + } final personalInfoModel = getPersonalInfo; final authProvider = context.read(); authProvider.storePatientPersonalInfo(personalInfoModel); From 5b78e4a6ae9f2d0de6f7afe28f7e17526da4e94c Mon Sep 17 00:00:00 2001 From: Varadraj75 Date: Wed, 8 Apr 2026 03:13:55 +0530 Subject: [PATCH 2/2] fix: show snackbar error for unselected relation and gender dropdowns in child mode --- .../lib/presentation/auth/personal_details_screen.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/patient/lib/presentation/auth/personal_details_screen.dart b/patient/lib/presentation/auth/personal_details_screen.dart index 87a9f75..8010dff 100644 --- a/patient/lib/presentation/auth/personal_details_screen.dart +++ b/patient/lib/presentation/auth/personal_details_screen.dart @@ -113,15 +113,11 @@ class _PersonalDetailsScreenState extends State { if (_formKey.currentState?.validate() ?? false) { if (isAssessmentForChild && selectedRelation.isEmpty) { - setState(() { - _validationErrors['relation'] = 'Please select your relation with the patient'; - }); + SnackbarService.showError('Please select your relation with the patient'); return; } if (isAssessmentForChild && (selectedChildGender == null || selectedChildGender!.isEmpty)) { - setState(() { - _validationErrors['gender'] = 'Please select patient gender'; - }); + SnackbarService.showError('Please select patient gender'); return; } final personalInfoModel = getPersonalInfo;