diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 9da3bc32..60ec80e3 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; @@ -15,7 +14,6 @@ import 'package:provider/provider.dart'; import '../../config/config.dart'; import '../../config/size_config.dart'; import '../../lookups/patient_lookup.dart'; -import '../../models/doctor/doctor_profile_model.dart'; import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; @@ -87,7 +85,7 @@ class _PatientSearchScreenState extends State { }); } } catch (err) { - error = err; + error = err.toString(); } } @@ -244,13 +242,14 @@ class _PatientSearchScreenState extends State { TranslationBase.of(context).firstName, borderColor: Colors.white, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues.setFirstName = "0" : _patientSearchFormValues.setFirstName = value; - if (value.toString().trim().isEmpty) { + if (value != null && + value.toString().trim().isEmpty) { _patientSearchFormValues.setFirstName = "0"; } }, @@ -274,14 +273,17 @@ class _PatientSearchScreenState extends State { TranslationBase.of(context).middleName, borderColor: Colors.white, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues.setMiddleName = "0" : _patientSearchFormValues.setMiddleName = value; - if (value.toString().trim().isEmpty) { + if (value != null && value + .toString() + .trim() + .isEmpty) { _patientSearchFormValues.setMiddleName = - "0"; + "0"; } }, // validator: (value) { @@ -303,12 +305,15 @@ class _PatientSearchScreenState extends State { labelText: TranslationBase.of(context).lastName, borderColor: Colors.white, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues.setLastName = "0" : _patientSearchFormValues.setLastName = value; - if (value.toString().trim().isEmpty) { + if (value != null && value + .toString() + .trim() + .isEmpty) { _patientSearchFormValues.setLastName = "0"; } }, @@ -331,13 +336,16 @@ class _PatientSearchScreenState extends State { textInputType: TextInputType.number, inputFormatter: ONLY_NUMBERS, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues .setPatientMobileNumber = "0" : _patientSearchFormValues .setPatientMobileNumber = value; - if (value.toString().trim().isEmpty) { + if (value != null && value + .toString() + .trim() + .isEmpty) { _patientSearchFormValues .setPatientMobileNumber = "0"; } @@ -366,7 +374,10 @@ class _PatientSearchScreenState extends State { 0 : _patientSearchFormValues.setPatientID = int.parse(value); - if (value.trim().toString().isEmpty) { + if (value != null && value + .trim() + .toString() + .isEmpty) { _patientSearchFormValues.setPatientID = 0; } }), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index ccc90fcb..57abe393 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -481,6 +481,10 @@ class _PatientsScreenState extends State { backGroundcolor: Colors.white, ), + SizedBox( + height: + 5, + ), ], ), Row( @@ -502,13 +506,13 @@ class _PatientsScreenState extends State { fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), - AppText( item.patientId.toString(), fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, backGroundcolor: Colors.white, - ),SizedBox( + ), + SizedBox( width: 10, ), ], @@ -517,15 +521,20 @@ class _PatientsScreenState extends State { height: 2.5, ), - AppText( - TranslationBase.of(context).nationality +" : "+( - item.nationalityName??item.nationality), - fontSize: - 1.8 * SizeConfig.textMultiplier, - fontWeight: - FontWeight.bold, - backGroundcolor: - Colors.white, + Container( + child: + AppText( + TranslationBase.of(context).nationality + " : " + (item.nationalityName ?? item.nationality), + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + ), + margin: + EdgeInsets.only(right: projectsProvider.isArabic ? 0 : 10, left: projectsProvider.isArabic ? 10 : 0), + ), + SizedBox( + width: + 10, ), SizedBox( height: @@ -590,16 +599,32 @@ class _PatientsScreenState extends State { Wrap( children: [ AppText( - TranslationBase.of(context).age2, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, + TranslationBase + .of( + context) + .age2, + fontSize: 1.8 * + SizeConfig + .textMultiplier, + fontWeight: FontWeight + .bold, + backGroundcolor: Colors + .white, ), AppText( - item.age.toString(), - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, + item + .age + .toString(), + fontSize: 1.8 * + SizeConfig + .textMultiplier, + fontWeight: FontWeight + .w300, + backGroundcolor: Colors + .white, + ), + SizedBox( + width: 10, ), ], ), @@ -607,6 +632,7 @@ class _PatientsScreenState extends State { height: 2.5, ), + Wrap( children: [ AppText(