fix small bug in allergies

merge-requests/484/head
Elham Rababah 4 years ago
parent e668fd3334
commit 6a6087e5ba

@ -242,11 +242,11 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
});
if (isAllDataFilled) {
mySelectedAllergy.forEach((element) {
if (!widget.myAllergiesList.contains(element)) {
if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) {
widget.myAllergiesList.add(element);
}
});
// changeParentState();
changeParentState();
Navigator.of(context).pop();
} else {
helpers.showErrorToast(TranslationBase

@ -240,106 +240,113 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
.arrowIosDownwardOutline))
],
),
bodyWidget: Column(
children: [
AppTextFieldCustom(
onClick: 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,
isDropDown: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
enabled: false,
maxLines: 2,
minLines: 2,
controller: severityController,),
SizedBox(
height: 5,
),
if(isSubmitted && mySelectedAllergy !=null &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
bodyWidget: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: Column(
children: [
AppTextFieldCustom(
onClick: 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,
isDropDown: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
enabled: false,
maxLines: 2,
minLines: 2,
controller: severityController,),
SizedBox(
height: 5,
),
if(isSubmitted && mySelectedAllergy !=null &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: NewTextFields(
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 3,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: NewTextFields(
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 3,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
}
},
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
}
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],),
),
),
],),
),
isExpand: mySelectedAllergy != null
? mySelectedAllergy.isExpanded
: false,

Loading…
Cancel
Save