From fc567213ed34522dbe9422839b0ed7942508a48b Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Mon, 4 Nov 2024 15:39:56 +0300 Subject: [PATCH] allergies work inprogress --- .../allergy/get_allergies_list_vida_plus.dart | 2 +- .../subjective/allergies/add_allergies.dart | 15 +----- .../allergies/reactions_selection.dart | 48 ++++++++++--------- 3 files changed, 29 insertions(+), 36 deletions(-) diff --git a/lib/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart b/lib/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart index 7618d57e..1e006cf8 100644 --- a/lib/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart +++ b/lib/core/model/SOAP/allergy/get_allergies_list_vida_plus.dart @@ -74,7 +74,7 @@ class AllergyReactionDTOs { int? hospitalGroupID; int? hospitalID; bool? isActive; - int? reactionSelection =1; + String? reactionSelection =""; AllergyReactionDTOs( {this.allergyReactionID, this.allergyReactionName, diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/add_allergies.dart index 1e24a2d8..a0eda071 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/add_allergies.dart @@ -65,22 +65,11 @@ class _AddAllergiesState extends State { builder: (_, model, w) { return MasterKeyCheckboxSearchAllergiesWidget( model: model, - // masterList: model.allergiesList, - // removeAllergy: (master) { - // // setState(() { - // // removeAllergyFromLocalList(master); - // // }); - // }, + addAllergy: (AllergiesListVidaPlus mySelectedAllergy) { widget.addAllergiesFun!(mySelectedAllergy); }, - // addSelectedAllergy: () { - // setState(() { - // widget.addAllergiesFun!(myAllergiesListLocal); - // }); - // }, - // isServiceSelected: (master) => isServiceSelected(master), - // getServiceSelectedAllergy: (master) => getSelectedAllergy(master), + ); }), ), diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/reactions_selection.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/reactions_selection.dart index c1746e35..2b8c5887 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/reactions_selection.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/allergies/reactions_selection.dart @@ -49,7 +49,7 @@ class _ReactionsSelectionAllergiesWidgetState // baseViewModel: model, isShowAppBar: true, appBar: BottomSheetTitle( - title: "Reactive" // TranslationBase.of(context).reac, + title: "Select Reactions" // TranslationBase.of(context).reac, ), backgroundColor: Color(0xffbacF7F7F7), body: Column( @@ -87,16 +87,17 @@ class _ReactionsSelectionAllergiesWidgetState activeColor: Color(0xffD02127), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, // Reduces padding around checkbox visualDensity: VisualDensity.compact, - value: widget - .mySelectedAllergy - .allergyReactionDTOs![index] - .reactionSelection, + value: "Mild", groupValue: widget .mySelectedAllergy - .allergyReactionDTOs![index] - .allergyReactionID, + .allergyReactionDTOs![index].reactionSelection, onChanged: (value) { - print(value); + widget + .mySelectedAllergy + .allergyReactionDTOs![index].reactionSelection =value; + setState(() { + + }); }, ), AppText('Mild', fontSize: 10,), @@ -111,16 +112,18 @@ class _ReactionsSelectionAllergiesWidgetState activeColor: Color(0xffD02127), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, // Reduces padding around checkbox visualDensity: VisualDensity.compact, - value: widget - .mySelectedAllergy - .allergyReactionDTOs![index] - .reactionSelection, + value: "moderate", groupValue: widget .mySelectedAllergy - .allergyReactionDTOs![index] - .allergyReactionID, + + .allergyReactionDTOs![index].reactionSelection, onChanged: (value) { - print(value); + widget + .mySelectedAllergy + .allergyReactionDTOs![index].reactionSelection =value; + setState(() { + + }); }, ), AppText('Moderate', fontSize: 10,), @@ -135,16 +138,17 @@ class _ReactionsSelectionAllergiesWidgetState activeColor: Color(0xffD02127), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, // Reduces padding around checkbox visualDensity: VisualDensity.compact, - value: widget - .mySelectedAllergy - .allergyReactionDTOs![index] - .reactionSelection, + value: "severe", groupValue: widget .mySelectedAllergy - .allergyReactionDTOs![index] - .allergyReactionID, + .allergyReactionDTOs![index].reactionSelection, onChanged: (value) { - print(value); + widget + .mySelectedAllergy + .allergyReactionDTOs![index].reactionSelection =value; + setState(() { + + }); }, ), AppText('Severe', fontSize: 10,),