diff --git a/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 5fa3535b..55ef144f 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -242,11 +242,11 @@ class _UpdateAllergiesWidgetState extends State { }); 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 diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 52aa5e99..d644eda3 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -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,