|
|
|
|
@ -89,87 +89,75 @@ class PatientInformationStepState extends State<PatientInformationStep> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildSectionTitle(String title) {
|
|
|
|
|
return Text(
|
|
|
|
|
title,
|
|
|
|
|
style: const TextStyle(fontWeight: FontWeight.w700, fontSize: 16)
|
|
|
|
|
).paddingSymmetrical(4, 0);
|
|
|
|
|
return Text(title, style: const TextStyle(fontWeight: FontWeight.w700, fontSize: 16)).paddingSymmetrical(4, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildIdentificationField(ReferralFormManager formManager) {
|
|
|
|
|
return Focus(
|
|
|
|
|
return TextInputWidget(
|
|
|
|
|
controller: _identificationController,
|
|
|
|
|
focusNode: _identificationFocusNode,
|
|
|
|
|
child: TextInputWidget(
|
|
|
|
|
controller: _identificationController,
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: ResponsiveExtension(12).h,
|
|
|
|
|
horizontal: ResponsiveExtension(16).h,
|
|
|
|
|
),
|
|
|
|
|
hintText: LocaleKeys.enterIdentificationNumber.tr(context: context),
|
|
|
|
|
labelText: LocaleKeys.identificationNumber.tr(context: context),
|
|
|
|
|
errorMessage: formManager.errors.patientIdentification,
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientIdentification),
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
formManager.updatePatientIdentification(value ?? '');
|
|
|
|
|
},
|
|
|
|
|
onSubmitted: (value) {
|
|
|
|
|
_nameFocusNode.requestFocus();
|
|
|
|
|
},
|
|
|
|
|
).paddingSymmetrical(0, 4),
|
|
|
|
|
);
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: ResponsiveExtension(12).h,
|
|
|
|
|
horizontal: ResponsiveExtension(16).h,
|
|
|
|
|
),
|
|
|
|
|
hintText: LocaleKeys.enterIdentificationNumber.tr(context: context),
|
|
|
|
|
labelText: LocaleKeys.identificationNumber.tr(context: context),
|
|
|
|
|
errorMessage: formManager.errors.patientIdentification,
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientIdentification),
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
formManager.updatePatientIdentification(value ?? '');
|
|
|
|
|
},
|
|
|
|
|
onSubmitted: (value) {
|
|
|
|
|
_nameFocusNode.requestFocus();
|
|
|
|
|
},
|
|
|
|
|
).paddingSymmetrical(0, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildPatientNameField(ReferralFormManager formManager) {
|
|
|
|
|
return Focus(
|
|
|
|
|
return TextInputWidget(
|
|
|
|
|
controller: _nameController,
|
|
|
|
|
focusNode: _nameFocusNode,
|
|
|
|
|
child: TextInputWidget(
|
|
|
|
|
controller: _nameController,
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: ResponsiveExtension(12).h,
|
|
|
|
|
horizontal: ResponsiveExtension(16).h,
|
|
|
|
|
),
|
|
|
|
|
hintText: LocaleKeys.patientName.tr(context: context),
|
|
|
|
|
labelText: LocaleKeys.name.tr(context: context),
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
errorMessage: formManager.errors.patientName,
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientName),
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
formManager.updatePatientName(value ?? '');
|
|
|
|
|
},
|
|
|
|
|
onSubmitted: (value) {
|
|
|
|
|
// Optionally move to next field or keep focus
|
|
|
|
|
},
|
|
|
|
|
).paddingSymmetrical(0, 4),
|
|
|
|
|
);
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: ResponsiveExtension(12).h, horizontal: ResponsiveExtension(16).h),
|
|
|
|
|
hintText: LocaleKeys.patientName.tr(context: context),
|
|
|
|
|
labelText: LocaleKeys.name.tr(context: context),
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
errorMessage: formManager.errors.patientName,
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientName),
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
formManager.updatePatientName(value ?? '');
|
|
|
|
|
},
|
|
|
|
|
onSubmitted: (value) {
|
|
|
|
|
_phoneFocusNode.requestFocus();
|
|
|
|
|
},
|
|
|
|
|
).paddingSymmetrical(0, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildPatientPhoneField(ReferralFormManager formManager) {
|
|
|
|
|
return Directionality(
|
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
|
child: Focus(
|
|
|
|
|
child: TextInputWidget(
|
|
|
|
|
labelText: LocaleKeys.phoneNumber.tr(context: context),
|
|
|
|
|
hintText: "5xxxxxxxx",
|
|
|
|
|
controller: _phoneController,
|
|
|
|
|
focusNode: _phoneFocusNode,
|
|
|
|
|
child: TextInputWidget(
|
|
|
|
|
labelText: LocaleKeys.phoneNumber.tr(context: context),
|
|
|
|
|
hintText: "5xxxxxxxx",
|
|
|
|
|
controller: _phoneController,
|
|
|
|
|
padding: const EdgeInsets.all(8),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
fontFamily: "Poppins",
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
formManager.updatePatientPhone(value ?? '');
|
|
|
|
|
},
|
|
|
|
|
onCountryChange: (value) {
|
|
|
|
|
formManager.updatePatientCountryEnum(value);
|
|
|
|
|
},
|
|
|
|
|
prefix: '966',
|
|
|
|
|
isBorderAllowed: false,
|
|
|
|
|
isAllowLeadingIcon: true,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
isCountryDropDown: true,
|
|
|
|
|
leadingIcon: AppAssets.smart_phone,
|
|
|
|
|
errorMessage: formManager.errors.patientPhone,
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientPhone)
|
|
|
|
|
).paddingSymmetrical(0, 8),
|
|
|
|
|
),
|
|
|
|
|
padding: const EdgeInsets.all(8),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
fontFamily: "Poppins",
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
formManager.updatePatientPhone(value ?? '');
|
|
|
|
|
},
|
|
|
|
|
onCountryChange: (value) {
|
|
|
|
|
formManager.updatePatientCountryEnum(value);
|
|
|
|
|
},
|
|
|
|
|
prefix: '966',
|
|
|
|
|
isBorderAllowed: false,
|
|
|
|
|
isAllowLeadingIcon: true,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
isCountryDropDown: true,
|
|
|
|
|
leadingIcon: AppAssets.smart_phone,
|
|
|
|
|
errorMessage: formManager.errors.patientPhone,
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientPhone),
|
|
|
|
|
).paddingSymmetrical(0, 8),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -185,19 +173,17 @@ class PatientInformationStepState extends State<PatientInformationStep> {
|
|
|
|
|
leadingIcon: AppAssets.globe,
|
|
|
|
|
dropdownItems: [],
|
|
|
|
|
errorMessage: formManager.errors.patientCity,
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientCity),
|
|
|
|
|
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.patientCity),
|
|
|
|
|
).paddingSymmetrical(0, 4).onPress(() {
|
|
|
|
|
_showCityBottomSheet(context, formManager);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String? getLocaleDescription(GetAllCitiesResponseModel? patientCity){
|
|
|
|
|
return getIt.get<AppState>().isArabic() ? patientCity?.descriptionN: patientCity?.description;
|
|
|
|
|
String? getLocaleDescription(GetAllCitiesResponseModel? patientCity) {
|
|
|
|
|
return getIt.get<AppState>().isArabic() ? patientCity?.descriptionN : patientCity?.description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _showCityBottomSheet(BuildContext context, ReferralFormManager formManager) {
|
|
|
|
|
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
title: LocaleKeys.selectCity.tr(context: context),
|
|
|
|
|
@ -216,25 +202,25 @@ class PatientInformationStepState extends State<PatientInformationStep> {
|
|
|
|
|
return DecoratedBox(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
customBorder: BorderRadius.all(Radius.circular(24.h)) ,
|
|
|
|
|
|
|
|
|
|
), child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
final city = cities[index];
|
|
|
|
|
return ListTile(
|
|
|
|
|
title: (getLocaleDescription(city) ?? 'Unknown').toText14(),
|
|
|
|
|
onTap: () {
|
|
|
|
|
formManager.updatePatientCity(city);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
customBorder: BorderRadius.all(Radius.circular(24.h)),
|
|
|
|
|
),
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
final city = cities[index];
|
|
|
|
|
return ListTile(
|
|
|
|
|
title: (getLocaleDescription(city) ?? 'Unknown').toText14(),
|
|
|
|
|
onTap: () {
|
|
|
|
|
formManager.updatePatientCity(city);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
// separatorBuilder: (context, index) => const Divider(),
|
|
|
|
|
itemCount: cities.length,
|
|
|
|
|
));
|
|
|
|
|
// separatorBuilder: (context, index) => const Divider(),
|
|
|
|
|
itemCount: cities.length,
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
useSafeArea: true,
|
|
|
|
|
@ -253,4 +239,4 @@ class PatientInformationStepState extends State<PatientInformationStep> {
|
|
|
|
|
_phoneFocusNode.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|