fix DA-237

merge-requests/260/head
Elham Rababah 5 years ago
parent c6156921e8
commit d53493aa52

@ -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/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.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/config.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../lookups/patient_lookup.dart'; import '../../lookups/patient_lookup.dart';
import '../../models/doctor/doctor_profile_model.dart';
import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/patients/dynamic_elements.dart';
import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_buttons_widget.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
@ -87,7 +85,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
}); });
} }
} catch (err) { } catch (err) {
error = err; error = err.toString();
} }
} }
@ -244,13 +242,14 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
TranslationBase.of(context).firstName, TranslationBase.of(context).firstName,
borderColor: Colors.white, borderColor: Colors.white,
onSaved: (value) { onSaved: (value) {
value == null value == null || value == ''
? _patientSearchFormValues.setFirstName = ? _patientSearchFormValues.setFirstName =
"0" "0"
: _patientSearchFormValues.setFirstName = : _patientSearchFormValues.setFirstName =
value; value;
if (value.toString().trim().isEmpty) { if (value != null &&
value.toString().trim().isEmpty) {
_patientSearchFormValues.setFirstName = "0"; _patientSearchFormValues.setFirstName = "0";
} }
}, },
@ -274,14 +273,17 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
TranslationBase.of(context).middleName, TranslationBase.of(context).middleName,
borderColor: Colors.white, borderColor: Colors.white,
onSaved: (value) { onSaved: (value) {
value == null value == null || value == ''
? _patientSearchFormValues.setMiddleName = ? _patientSearchFormValues.setMiddleName =
"0" "0"
: _patientSearchFormValues.setMiddleName = : _patientSearchFormValues.setMiddleName =
value; value;
if (value.toString().trim().isEmpty) { if (value != null && value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setMiddleName = _patientSearchFormValues.setMiddleName =
"0"; "0";
} }
}, },
// validator: (value) { // validator: (value) {
@ -303,12 +305,15 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
labelText: TranslationBase.of(context).lastName, labelText: TranslationBase.of(context).lastName,
borderColor: Colors.white, borderColor: Colors.white,
onSaved: (value) { onSaved: (value) {
value == null value == null || value == ''
? _patientSearchFormValues.setLastName = ? _patientSearchFormValues.setLastName =
"0" "0"
: _patientSearchFormValues.setLastName = : _patientSearchFormValues.setLastName =
value; value;
if (value.toString().trim().isEmpty) { if (value != null && value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setLastName = "0"; _patientSearchFormValues.setLastName = "0";
} }
}, },
@ -331,13 +336,16 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
textInputType: TextInputType.number, textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
value == null value == null || value == ''
? _patientSearchFormValues ? _patientSearchFormValues
.setPatientMobileNumber = "0" .setPatientMobileNumber = "0"
: _patientSearchFormValues : _patientSearchFormValues
.setPatientMobileNumber = value; .setPatientMobileNumber = value;
if (value.toString().trim().isEmpty) { if (value != null && value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues _patientSearchFormValues
.setPatientMobileNumber = "0"; .setPatientMobileNumber = "0";
} }
@ -366,7 +374,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
0 0
: _patientSearchFormValues.setPatientID = : _patientSearchFormValues.setPatientID =
int.parse(value); int.parse(value);
if (value.trim().toString().isEmpty) { if (value != null && value
.trim()
.toString()
.isEmpty) {
_patientSearchFormValues.setPatientID = 0; _patientSearchFormValues.setPatientID = 0;
} }
}), }),

@ -481,6 +481,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
backGroundcolor: backGroundcolor:
Colors.white, Colors.white,
), ),
SizedBox(
height:
5,
),
], ],
), ),
Row( Row(
@ -502,13 +506,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
), ),
AppText( AppText(
item.patientId.toString(), item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
),SizedBox( ),
SizedBox(
width: 10, width: 10,
), ),
], ],
@ -517,15 +521,20 @@ class _PatientsScreenState extends State<PatientsScreen> {
height: height:
2.5, 2.5,
), ),
AppText( Container(
TranslationBase.of(context).nationality +" : "+( child:
item.nationalityName??item.nationality), AppText(
fontSize: TranslationBase.of(context).nationality + " : " + (item.nationalityName ?? item.nationality),
1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold, backGroundcolor: Colors.white,
backGroundcolor: ),
Colors.white, margin:
EdgeInsets.only(right: projectsProvider.isArabic ? 0 : 10, left: projectsProvider.isArabic ? 10 : 0),
),
SizedBox(
width:
10,
), ),
SizedBox( SizedBox(
height: height:
@ -590,16 +599,32 @@ class _PatientsScreenState extends State<PatientsScreen> {
Wrap( Wrap(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).age2, TranslationBase
fontSize: 1.8 * SizeConfig.textMultiplier, .of(
fontWeight: FontWeight.bold, context)
backGroundcolor: Colors.white, .age2,
fontSize: 1.8 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight
.bold,
backGroundcolor: Colors
.white,
), ),
AppText( AppText(
item.age.toString(), item
fontSize: 1.8 * SizeConfig.textMultiplier, .age
fontWeight: FontWeight.w300, .toString(),
backGroundcolor: Colors.white, fontSize: 1.8 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight
.w300,
backGroundcolor: Colors
.white,
),
SizedBox(
width: 10,
), ),
], ],
), ),
@ -607,6 +632,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
height: height:
2.5, 2.5,
), ),
Wrap( Wrap(
children: [ children: [
AppText( AppText(

Loading…
Cancel
Save