|
|
|
@ -96,115 +96,149 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
|
|
|
|
child: ListView.builder(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount: items.length,
|
|
|
|
itemCount: items.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
bool isSelected = widget.isServiceSelected(
|
|
|
|
bool isSelected =
|
|
|
|
items[index]);
|
|
|
|
widget.isServiceSelected(items[index]);
|
|
|
|
MySelectedAllergy mySelectedAllergy;
|
|
|
|
MySelectedAllergy mySelectedAllergy;
|
|
|
|
if (isSelected) {
|
|
|
|
if (isSelected) {
|
|
|
|
mySelectedAllergy = widget
|
|
|
|
mySelectedAllergy =
|
|
|
|
.getServiceSelectedAllergy(
|
|
|
|
widget.getServiceSelectedAllergy(
|
|
|
|
items[index]);
|
|
|
|
items[index]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TextEditingController remarkController = TextEditingController(
|
|
|
|
TextEditingController remarkController =
|
|
|
|
text: isSelected ? mySelectedAllergy
|
|
|
|
TextEditingController(
|
|
|
|
.remark : null);
|
|
|
|
text: isSelected
|
|
|
|
TextEditingController severityController = TextEditingController(
|
|
|
|
? mySelectedAllergy.remark
|
|
|
|
text: isSelected ? mySelectedAllergy
|
|
|
|
: null);
|
|
|
|
.selectedAllergySeverity != null
|
|
|
|
TextEditingController severityController =
|
|
|
|
? projectViewModel
|
|
|
|
TextEditingController(
|
|
|
|
.isArabic
|
|
|
|
text: isSelected
|
|
|
|
? mySelectedAllergy
|
|
|
|
? mySelectedAllergy
|
|
|
|
.selectedAllergySeverity
|
|
|
|
.selectedAllergySeverity !=
|
|
|
|
.nameAr
|
|
|
|
null
|
|
|
|
: mySelectedAllergy
|
|
|
|
? projectViewModel.isArabic
|
|
|
|
.selectedAllergySeverity
|
|
|
|
? mySelectedAllergy
|
|
|
|
.nameEn
|
|
|
|
.selectedAllergySeverity
|
|
|
|
: null : null);
|
|
|
|
.nameAr
|
|
|
|
|
|
|
|
: mySelectedAllergy
|
|
|
|
|
|
|
|
.selectedAllergySeverity
|
|
|
|
|
|
|
|
.nameEn
|
|
|
|
|
|
|
|
: null
|
|
|
|
|
|
|
|
: null);
|
|
|
|
return HeaderBodyExpandableNotifier(
|
|
|
|
return HeaderBodyExpandableNotifier(
|
|
|
|
headerWidget: InkWell(
|
|
|
|
headerWidget: Row(
|
|
|
|
onTap: () {
|
|
|
|
mainAxisAlignment:
|
|
|
|
setState(() {
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
if (widget.isServiceSelected(
|
|
|
|
children: [
|
|
|
|
items[index])) {
|
|
|
|
Row(
|
|
|
|
widget
|
|
|
|
children: [
|
|
|
|
.removeAllergy(
|
|
|
|
Checkbox(
|
|
|
|
items[index]);
|
|
|
|
value:
|
|
|
|
} else {
|
|
|
|
widget.isServiceSelected(
|
|
|
|
// TODO add Allergy
|
|
|
|
items[index]),
|
|
|
|
|
|
|
|
activeColor: Colors.red[800],
|
|
|
|
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// if (widget
|
|
|
|
|
|
|
|
// .isServiceSelected(items[index])) {
|
|
|
|
|
|
|
|
// widget.removeHistory(items[index]);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// widget.addHistory(items[index]);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
if (widget
|
|
|
|
|
|
|
|
.isServiceSelected(
|
|
|
|
|
|
|
|
items[index])) {
|
|
|
|
|
|
|
|
widget.removeAllergy(
|
|
|
|
|
|
|
|
items[index]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// TODO add Allergy
|
|
|
|
|
|
|
|
|
|
|
|
MySelectedAllergy
|
|
|
|
MySelectedAllergy
|
|
|
|
mySelectedAllergy =
|
|
|
|
mySelectedAllergy =
|
|
|
|
new MySelectedAllergy(
|
|
|
|
new MySelectedAllergy(
|
|
|
|
selectedAllergy:
|
|
|
|
selectedAllergy:
|
|
|
|
items[index],
|
|
|
|
items[index],
|
|
|
|
selectedAllergySeverity:
|
|
|
|
selectedAllergySeverity:
|
|
|
|
_selectedAllergySeverity,
|
|
|
|
_selectedAllergySeverity,
|
|
|
|
remark: null,
|
|
|
|
remark: null,
|
|
|
|
isChecked: true);
|
|
|
|
isChecked: true,
|
|
|
|
widget.addAllergy(
|
|
|
|
isExpanded: true);
|
|
|
|
mySelectedAllergy);
|
|
|
|
widget.addAllergy(
|
|
|
|
}
|
|
|
|
mySelectedAllergy);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
child: Row(
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
child: Expanded(
|
|
|
|
Checkbox(
|
|
|
|
child: Padding(
|
|
|
|
value: widget
|
|
|
|
padding: const EdgeInsets
|
|
|
|
.isServiceSelected(
|
|
|
|
.symmetric(
|
|
|
|
items[index]),
|
|
|
|
horizontal: 10,
|
|
|
|
activeColor:
|
|
|
|
vertical: 0),
|
|
|
|
Colors.red[800],
|
|
|
|
child: Container(
|
|
|
|
onChanged: (bool newValue) {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
child: AppText(
|
|
|
|
// if (widget
|
|
|
|
projectViewModel.isArabic
|
|
|
|
// .isServiceSelected(items[index])) {
|
|
|
|
? items[index]
|
|
|
|
// widget.removeHistory(items[index]);
|
|
|
|
.nameAr !=
|
|
|
|
// } else {
|
|
|
|
""
|
|
|
|
// widget.addHistory(items[index]);
|
|
|
|
? items[index]
|
|
|
|
// }
|
|
|
|
.nameAr
|
|
|
|
// });
|
|
|
|
: items[index]
|
|
|
|
}),
|
|
|
|
.nameEn
|
|
|
|
Expanded(
|
|
|
|
: items[index].nameEn,
|
|
|
|
child: Padding(
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
padding: const EdgeInsets
|
|
|
|
fontSize: 16,
|
|
|
|
.symmetric(
|
|
|
|
fontWeight:
|
|
|
|
horizontal: 10,
|
|
|
|
FontWeight.w600,
|
|
|
|
vertical: 0),
|
|
|
|
),
|
|
|
|
child: AppText(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.55,
|
|
|
|
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,
|
|
|
|
InkWell(
|
|
|
|
child: Icon(
|
|
|
|
onTap: () {
|
|
|
|
isSelected ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline))
|
|
|
|
if (mySelectedAllergy != null) {
|
|
|
|
],
|
|
|
|
setState(() {
|
|
|
|
),
|
|
|
|
mySelectedAllergy
|
|
|
|
|
|
|
|
.isExpanded =
|
|
|
|
|
|
|
|
mySelectedAllergy
|
|
|
|
|
|
|
|
.isExpanded
|
|
|
|
|
|
|
|
? false
|
|
|
|
|
|
|
|
: true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Icon((mySelectedAllergy !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? mySelectedAllergy
|
|
|
|
|
|
|
|
.isExpanded
|
|
|
|
|
|
|
|
: false)
|
|
|
|
|
|
|
|
? EvaIcons
|
|
|
|
|
|
|
|
.arrowIosUpwardOutline
|
|
|
|
|
|
|
|
: EvaIcons
|
|
|
|
|
|
|
|
.arrowIosDownwardOutline))
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bodyWidget: isSelected?Column(children: [
|
|
|
|
bodyWidget: Column(
|
|
|
|
TextFields(
|
|
|
|
children: [
|
|
|
|
onTapTextFields: widget.model
|
|
|
|
TextFields(
|
|
|
|
.allergySeverityList !=
|
|
|
|
onTapTextFields: widget.model
|
|
|
|
null
|
|
|
|
.allergySeverityList !=
|
|
|
|
? () {
|
|
|
|
null
|
|
|
|
MasterKeyDailog dialog =
|
|
|
|
? () {
|
|
|
|
MasterKeyDailog(
|
|
|
|
MasterKeyDailog dialog =
|
|
|
|
list: widget.model
|
|
|
|
MasterKeyDailog(
|
|
|
|
.allergySeverityList,
|
|
|
|
list: widget.model
|
|
|
|
okText:
|
|
|
|
.allergySeverityList,
|
|
|
|
TranslationBase.of(
|
|
|
|
okText:
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
context)
|
|
|
|
context)
|
|
|
|
.ok,
|
|
|
|
.ok,
|
|
|
|
okFunction:
|
|
|
|
okFunction:
|
|
|
|
@ -228,9 +262,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
hasLabelText:
|
|
|
|
hasLabelText:
|
|
|
|
mySelectedAllergy
|
|
|
|
mySelectedAllergy != null &&
|
|
|
|
.selectedAllergySeverity !=
|
|
|
|
mySelectedAllergy
|
|
|
|
null
|
|
|
|
.selectedAllergySeverity !=
|
|
|
|
|
|
|
|
null
|
|
|
|
? true
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
: false,
|
|
|
|
showLabelText: true,
|
|
|
|
showLabelText: true,
|
|
|
|
@ -315,8 +350,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],):Column(),
|
|
|
|
],),
|
|
|
|
isExpand: isSelected,
|
|
|
|
isExpand: mySelectedAllergy != null
|
|
|
|
|
|
|
|
? mySelectedAllergy.isExpanded
|
|
|
|
|
|
|
|
: false,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|