make allergies as expandable widget

merge-requests/452/head
Elham Rababah 4 years ago
parent e6f2ed5197
commit d987859865

@ -2301,5 +2301,4 @@
]
}
]
}
}
}

@ -205,10 +205,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
doctorID: '');
await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true;
complaintsController.text = helpers.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text = model.patientChiefComplaintList[0].currentMedication + '\n \n';
medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication;
}
await getHistory(model);

@ -98,7 +98,7 @@ class _AppDrawerState extends State<AppDrawer> {
// " or " +
// TranslationBase.of(context).leaves,
DoctorApp.leaves,
DoctorApp.reschedule__1,
// subTitle: ,
),
onTap: () {
@ -121,15 +121,6 @@ class _AppDrawerState extends State<AppDrawer> {
margin: EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, Icons.settings),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
InkWell(
child: DrawerItem(
projectsProvider.isArabic
@ -143,6 +134,16 @@ class _AppDrawerState extends State<AppDrawer> {
projectsProvider.changeLanguage('ar');
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, DoctorApp.logout_1),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
],
),
),

@ -14,6 +14,7 @@ import 'package:provider/provider.dart';
import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart';
import 'expandable-widget-header-body.dart';
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final SOAPViewModel model;
@ -118,7 +119,210 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
.selectedAllergySeverity
.nameEn
: null : null);
return Column(
return HeaderBodyExpandableNotifier(
headerWidget: InkWell(
onTap: () {
setState(() {
if (widget.isServiceSelected(
items[index])) {
widget
.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Row(
children: [
Checkbox(
value: widget
.isServiceSelected(
items[index]),
activeColor:
Colors.red[800],
onChanged: (bool newValue) {
// setState(() {
// if (widget
// .isServiceSelected(items[index])) {
// widget.removeHistory(items[index]);
// } else {
// widget.addHistory(items[index]);
// }
// });
}),
Expanded(
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: AppText(
projectViewModel.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index].nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
),
),
InkWell(
// onTap: onTap,
child: Icon(
isSelected ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline))
],
),
),
bodyWidget: isSelected?Column(children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
hasLabelText:
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
};
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],):Column(),
isExpand: isSelected,
);
Column(
children: [
InkWell(
onTap: () {

Loading…
Cancel
Save