|
|
|
@ -1,5 +1,9 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/routes.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
|
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
|
import '../../util/text_validator.dart';
|
|
|
|
|
import '../../widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import '../../widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import '../../widgets/shared/app_text_form_field.dart';
|
|
|
|
@ -11,6 +15,9 @@ import 'package:flutter/rendering.dart';
|
|
|
|
|
import '../../lookups/patient_lookup.dart';
|
|
|
|
|
import '../../models/patient_model.dart';
|
|
|
|
|
import '../../widgets/patients/dynamic_elements.dart';
|
|
|
|
|
import '../../config/config.dart';
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
|
|
|
|
|
// OWNER : Ibrahim albitar
|
|
|
|
|
// DATE : 19-04-2020
|
|
|
|
@ -29,9 +36,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
bool _autoValidate = false;
|
|
|
|
|
|
|
|
|
|
var _patientSearchFormValues = PatientModel(
|
|
|
|
|
ProjectID: 12,
|
|
|
|
|
ClinicID: 17,
|
|
|
|
|
DoctorID: 98129,
|
|
|
|
|
ProjectID: 15,
|
|
|
|
|
ClinicID: 0,
|
|
|
|
|
DoctorID: 4709,
|
|
|
|
|
FirstName: "0",
|
|
|
|
|
MiddleName: "0",
|
|
|
|
|
LastName: "0",
|
|
|
|
@ -50,18 +57,31 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
IsLoginForDoctorApp: true,
|
|
|
|
|
PatientOutSA: false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _validateInputs() {
|
|
|
|
|
if (_formKey.currentState.validate()) {
|
|
|
|
|
print("####IBRAHIM TEST#####"+_patientSearchFormValues.From);
|
|
|
|
|
// _patientSearchFormValues.TokenID =
|
|
|
|
|
|
|
|
|
|
if (_formKey.currentState.validate()) {
|
|
|
|
|
// If all data are correct then save data to out variables
|
|
|
|
|
_formKey.currentState.save();
|
|
|
|
|
} else {
|
|
|
|
|
_formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
sharedPref.getString(TOKEN).then((token) {
|
|
|
|
|
print(token+"EEEEEE");
|
|
|
|
|
_patientSearchFormValues.TokenID = token;
|
|
|
|
|
_patientSearchFormValues.ProjectID= 15;
|
|
|
|
|
print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf");
|
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS, arguments: {
|
|
|
|
|
"patientSearchForm": _patientSearchFormValues,
|
|
|
|
|
"selectedType": _selectedType
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// If all data are not valid then start auto validation.
|
|
|
|
|
setState(() {
|
|
|
|
|
_autoValidate = true;
|
|
|
|
|
});
|
|
|
|
|
setState(() {
|
|
|
|
|
_autoValidate = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -154,9 +174,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.FirstName = value;
|
|
|
|
|
},
|
|
|
|
|
validator: (value) {
|
|
|
|
|
return TextValidator().validateName(value);
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_LETTERS
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
@ -166,9 +187,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.MiddleName = value;
|
|
|
|
|
},
|
|
|
|
|
validator: (value) {
|
|
|
|
|
return TextValidator().validateName(value);
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_LETTERS
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
@ -178,9 +200,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.LastName = value;
|
|
|
|
|
},
|
|
|
|
|
validator: (value) {
|
|
|
|
|
return TextValidator().validateName(value);
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_LETTERS
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
@ -188,9 +211,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
hintText: 'Phone Number',
|
|
|
|
|
validator: (value) {
|
|
|
|
|
return TextValidator().validateMobile(value);
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateMobile(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.PatientMobileNumber =
|
|
|
|
|
value;
|
|
|
|
@ -202,12 +226,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
hintText: 'Patiant ID',
|
|
|
|
|
validator: (value) {
|
|
|
|
|
return TextValidator().validateIdNumber(value);
|
|
|
|
|
},
|
|
|
|
|
//
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_patientSearchFormValues.PatientID =
|
|
|
|
|
89000;
|
|
|
|
|
_patientSearchFormValues.PatientID = 89000;
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
@ -215,9 +237,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
hintText: 'Patiant File',
|
|
|
|
|
validator: (value) {
|
|
|
|
|
return TextValidator().validateIdNumber(value);
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateIdNumber(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
//_patientSearchFormValues. = value;
|
|
|
|
|
},
|
|
|
|
|