fix small bug in allergies

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

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

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

Loading…
Cancel
Save