|
|
|
@ -43,7 +43,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
bool _autoValidate = false;
|
|
|
|
|
bool onlyArrived = true;
|
|
|
|
|
|
|
|
|
|
bool isView = false;
|
|
|
|
|
bool isFormSubmitted = false;
|
|
|
|
|
|
|
|
|
|
FocusNode _nodeText1 = FocusNode();
|
|
|
|
@ -120,324 +120,293 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
|
},
|
|
|
|
|
child: AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).searchPatient,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: ListView(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: Icon(
|
|
|
|
|
DoctorApp.search_patient_1,
|
|
|
|
|
size: 100,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 12.0),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.searchPatientImageCaptionTitle
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: SizeConfig.heightMultiplier * 2.5,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 5.0),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.searchPatientImageCaptionBody,
|
|
|
|
|
fontSize: SizeConfig.heightMultiplier * 2,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).searchPatient,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: ListView(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// Container(
|
|
|
|
|
// child: Icon(
|
|
|
|
|
// DoctorApp.search_patient_1,
|
|
|
|
|
// size: 100,
|
|
|
|
|
// color: Colors.black,
|
|
|
|
|
// ),
|
|
|
|
|
// margin: EdgeInsets.only(top: 10),
|
|
|
|
|
// ),
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: const EdgeInsets.only(top: 12.0),
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .searchPatientImageCaptionTitle
|
|
|
|
|
// .toUpperCase(),
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// fontSize: SizeConfig.heightMultiplier * 2.5,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: const EdgeInsets.only(top: 5.0),
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .searchPatientImageCaptionBody,
|
|
|
|
|
// fontSize: SizeConfig.heightMultiplier * 2,
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
width: SizeConfig.screenWidth * 1,
|
|
|
|
|
child: Form(
|
|
|
|
|
key: _formKey,
|
|
|
|
|
autovalidate: _autoValidate,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
width: SizeConfig.screenWidth * 1,
|
|
|
|
|
child: Form(
|
|
|
|
|
key: _formKey,
|
|
|
|
|
autovalidate: _autoValidate,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 40.0,
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
color: HexColor("#CCCCCC")),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedType,
|
|
|
|
|
iconSize: 25,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return PATIENT_TYPE.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
!projectsProvider.isArabic
|
|
|
|
|
? AppText(
|
|
|
|
|
item['text'],
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
item['text_ar'],
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (String newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedType = newValue;
|
|
|
|
|
selectedPatientType =
|
|
|
|
|
int.parse(_selectedType);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: PATIENT_TYPE.map((item) {
|
|
|
|
|
!projectsProvider.isArabic
|
|
|
|
|
? itemText = item['text']
|
|
|
|
|
: itemText = item['text_ar'];
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: Text(
|
|
|
|
|
itemText,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
value: item['val'],
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
if (_selectedType != '7')
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).firstName,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setFirstName = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setFirstName = value;
|
|
|
|
|
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues.setFirstName =
|
|
|
|
|
"0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).middleName,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setMiddleName = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setMiddleName = value;
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues.setMiddleName =
|
|
|
|
|
"0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).lastName,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues.setLastName =
|
|
|
|
|
"0"
|
|
|
|
|
: _patientSearchFormValues.setLastName =
|
|
|
|
|
value;
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues.setLastName =
|
|
|
|
|
"0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
if (_selectedType != '7')
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).phoneNumber,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
focusNode: _nodeText1,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = value;
|
|
|
|
|
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = "0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).patientID,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
focusNode: _nodeText2,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setPatientID = 0
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setPatientID = int.parse(value);
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.trim().toString().isEmpty) {
|
|
|
|
|
_patientSearchFormValues.setPatientID = 0;
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.only(top: 5),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).patientFile,
|
|
|
|
|
TranslationBase.of(context).phoneNumber,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
focusNode: _nodeText3,
|
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
onSaved: (value) {},
|
|
|
|
|
focusNode: _nodeText1,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = value;
|
|
|
|
|
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues
|
|
|
|
|
.setPatientMobileNumber = "0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
(!(_selectedType == '2' || _selectedType == '4'))
|
|
|
|
|
? DynamicElements(
|
|
|
|
|
_patientSearchFormValues, isFormSubmitted)
|
|
|
|
|
: SizedBox(
|
|
|
|
|
height: 0,
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
child: this.isView == false
|
|
|
|
|
? AppText(
|
|
|
|
|
'Search With Other Critearia',
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
: AppText('Hide Other Criteria',
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
this.isView = !this.isView;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
isView == true
|
|
|
|
|
? Column(children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 65.0,
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
color: HexColor("#CCCCCC")),
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom:
|
|
|
|
|
SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedType,
|
|
|
|
|
iconSize: 25,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return PATIENT_TYPE.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize:
|
|
|
|
|
MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
!projectsProvider.isArabic
|
|
|
|
|
? AppText(
|
|
|
|
|
item['text'],
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
item['text_ar'],
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (String newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedType = newValue;
|
|
|
|
|
selectedPatientType =
|
|
|
|
|
int.parse(_selectedType);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: PATIENT_TYPE.map((item) {
|
|
|
|
|
!projectsProvider.isArabic
|
|
|
|
|
? itemText = item['text']
|
|
|
|
|
: itemText =
|
|
|
|
|
item['text_ar'];
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: Text(
|
|
|
|
|
itemText,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
value: item['val'],
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context)
|
|
|
|
|
.firstName,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setFirstName = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setFirstName = value;
|
|
|
|
|
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues
|
|
|
|
|
.setFirstName = "0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context)
|
|
|
|
|
.middleName,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setMiddleName = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setMiddleName = value;
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues
|
|
|
|
|
.setMiddleName = "0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context)
|
|
|
|
|
.lastName,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setLastName = "0"
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setLastName = value;
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.toString().trim().isEmpty) {
|
|
|
|
|
_patientSearchFormValues
|
|
|
|
|
.setLastName = "0";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
inputFormatter: ONLY_LETTERS),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
@ -445,52 +414,132 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 25,
|
|
|
|
|
child: Checkbox(
|
|
|
|
|
value: onlyArrived,
|
|
|
|
|
checkColor: HexColor("#2A930A"),
|
|
|
|
|
activeColor: Colors.white,
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
onlyArrived = newValue;
|
|
|
|
|
});
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context)
|
|
|
|
|
.patientID,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
focusNode: _nodeText2,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
value == null || value == ''
|
|
|
|
|
? _patientSearchFormValues
|
|
|
|
|
.setPatientID = 0
|
|
|
|
|
: _patientSearchFormValues
|
|
|
|
|
.setPatientID =
|
|
|
|
|
int.parse(value);
|
|
|
|
|
if (value != null &&
|
|
|
|
|
value.trim().toString().isEmpty) {
|
|
|
|
|
_patientSearchFormValues
|
|
|
|
|
.setPatientID = 0;
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 12,
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.onlyArrivedPatient,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2),
|
|
|
|
|
])),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context)
|
|
|
|
|
.patientFile,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
focusNode: _nodeText3,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
onSaved: (value) {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
(!(_selectedType == '2' ||
|
|
|
|
|
_selectedType == '4'))
|
|
|
|
|
? DynamicElements(
|
|
|
|
|
_patientSearchFormValues,
|
|
|
|
|
isFormSubmitted)
|
|
|
|
|
: SizedBox(
|
|
|
|
|
height: 0,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 25,
|
|
|
|
|
child: Checkbox(
|
|
|
|
|
value: onlyArrived,
|
|
|
|
|
checkColor: HexColor("#2A930A"),
|
|
|
|
|
activeColor: Colors.white,
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
onlyArrived = newValue;
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 12,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.onlyArrivedPatient,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier * 2),
|
|
|
|
|
])),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
])
|
|
|
|
|
: SizedBox(
|
|
|
|
|
height: SizeConfig.screenHeight * .4,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context).search,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
_validateInputs();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context).search,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
_validateInputs();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|