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/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<PatientSearchScreen> {
});
}
} catch (err) {
error = err;
error = err.toString();
}
}
@ -244,13 +242,14 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
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<PatientSearchScreen> {
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<PatientSearchScreen> {
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<PatientSearchScreen> {
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<PatientSearchScreen> {
0
: _patientSearchFormValues.setPatientID =
int.parse(value);
if (value.trim().toString().isEmpty) {
if (value != null && value
.trim()
.toString()
.isEmpty) {
_patientSearchFormValues.setPatientID = 0;
}
}),

@ -481,6 +481,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
backGroundcolor:
Colors.white,
),
SizedBox(
height:
5,
),
],
),
Row(
@ -502,13 +506,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
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<PatientsScreen> {
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<PatientsScreen> {
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<PatientsScreen> {
height:
2.5,
),
Wrap(
children: [
AppText(

Loading…
Cancel
Save