diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart index ea870eb9..28e67a93 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/enter_diagnosis.dart @@ -113,35 +113,33 @@ class _EnterDiagnosisState extends State { }, ), ), - Positioned( - child: Material( - elevation: 4.0, // Optional: for shadow effect - child: ConstrainedBox( - constraints: BoxConstraints(minHeight: 0, maxHeight: 300), - child: ListView.builder( - shrinkWrap: true, - itemCount: model.icdVersionList.length, - itemBuilder: (context, index) { - return ListTile( - title: InkWell( - child: AppText(model.icdVersionList[index]), - onTap: () { - setState( - () { - selectedDiagnosis = - model.findTheDiagnosisItem( - model.icdVersionList[index]); - filteredSearchController.text = - model.icdVersionList[index]; - model.searchDiagnosisList.clear(); - model.icdVersionList.clear(); - }, - ); - }, - ), - ); - }, - ), + Material( + elevation: 4.0, // Optional: for shadow effect + child: ConstrainedBox( + constraints: BoxConstraints(minHeight: 0, maxHeight: 300), + child: ListView.builder( + shrinkWrap: true, + itemCount: model.icdVersionList.length, + itemBuilder: (context, index) { + return ListTile( + title: InkWell( + child: AppText(model.icdVersionList[index]), + onTap: () { + setState( + () { + selectedDiagnosis = + model.findTheDiagnosisItem( + model.icdVersionList[index]); + filteredSearchController.text = + model.icdVersionList[index]; + model.searchDiagnosisList.clear(); + model.icdVersionList.clear(); + }, + ); + }, + ), + ); + }, ), ), ), diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart index 8e61432a..c6826dbc 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart @@ -104,7 +104,8 @@ class _AddChiefComplaintState extends State { }); } episodeByChiefComplaint(SOAPViewModel model) async{ - await model.episodeByChiefComplaint(widget.patientInfo); + WidgetsBinding.instance.addPostFrameCallback((_) async{ + await model.episodeByChiefComplaint(widget.patientInfo);}); } createCCByEpisode(model, List chiefComplaint) async{ diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart index fa801b4c..f209ed4b 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart @@ -281,8 +281,9 @@ class _ComplaintSelectionState extends State { ),) ],), - Stack(children: [ - Positioned(child:Material( + Padding( + padding: const EdgeInsets.all(8.0), + child: Material( elevation: 4.0, // Optional: for shadow effect child: ConstrainedBox( @@ -304,7 +305,8 @@ class _ComplaintSelectionState extends State { widget.onSave!(cc!); searchController.text =''; })); - }))))]), + }))), + ), SizedBox( height: 43, diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart index a91707aa..3fa49ba4 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart @@ -44,19 +44,14 @@ class _ComplaintItemsState extends State { textAlign: TextAlign.center, ), ), - widget.isDeletable ? Positioned( - top:0, - bottom: 0, - right: 10, - child: InkWell( - onTap: () { - widget.onCrossClicked(widget.complaint); - }, - child: Icon( - Icons.close, - size: 18, - color: Color(0xFFD02127), - ), + widget.isDeletable ? InkWell( + onTap: () { + widget.onCrossClicked(widget.complaint); + }, + child: Icon( + Icons.close, + size: 18, + color: Color(0xFFD02127), ), ) :SizedBox() ],), diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/medication/update_medication_widget.dart index 91cfd08c..a0882796 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/medication/update_medication_widget.dart @@ -17,6 +17,7 @@ import 'add_medication.dart'; class UpdateMedicationWidget extends StatefulWidget { final PatiantInformtion patientInfo; + UpdateMedicationWidget({ Key? key, required this.patientInfo, @@ -33,77 +34,63 @@ class _UpdateMedicationWidgetState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - model.getHomeMedication(widget.patientInfo); + WidgetsBinding.instance.addPostFrameCallback((_) { + model.getHomeMedication(widget.patientInfo); + }); }, - builder: (_, model, w) => - Column( - children: [ - AddSoapItem( - title: "${TranslationBase - .of(context) - .addMedication}", - onAddSoapItemClicked: () { - Navigator.push( - context, - FadePage( - page: AddMedication( - patientInfo: widget.patientInfo, - addMedicationFun:(){ - - } - ) - - )); - // openMedicationList(context); - }, - ), - SizedBox( - height: 20, - ), - ListView( - padding: EdgeInsets.all(10), - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - children: model.getHomeMedicationList!.map((medication) { - return ListTile( - trailing: TextButton.icon( - onPressed: () { - removeMedication(medication, model); - }, - icon: SvgPicture.asset( - "assets/images/svgs/delete.svg", - height: 18, - color: Color(0xffD02127), - ), - label: AppText( - TranslationBase.of(context) - .remove, - fontSize: 12, - color: Color(0xffD02127))), - title: - - AppText( - medication.prescribedItemName!, - fontSize: 12, - fontWeight: FontWeight.w800, - letterSpacing: -0.48, - ), - subtitle: AppText( - '${medication.doseQuantity!} - ${ medication.frequencyString!}', - fontSize: 10, - + builder: (_, model, w) => Column(children: [ + AddSoapItem( + title: "${TranslationBase.of(context).addMedication}", + onAddSoapItemClicked: () { + Navigator.push( + context, + FadePage( + page: AddMedication( + patientInfo: widget.patientInfo, + addMedicationFun: () {}))); + // openMedicationList(context); + }, + ), + SizedBox( + height: 20, + ), + ListView( + padding: EdgeInsets.all(10), + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + children: model.getHomeMedicationList!.map((medication) { + return ListTile( + trailing: TextButton.icon( + onPressed: () { + removeMedication(medication, model); + }, + icon: SvgPicture.asset( + "assets/images/svgs/delete.svg", + height: 18, + color: Color(0xffD02127), ), - ); - }).toList()), - - - ] - )); + label: AppText(TranslationBase.of(context).remove, + fontSize: 12, color: Color(0xffD02127))), + title: AppText( + medication.prescribedItemName!, + fontSize: 12, + fontWeight: FontWeight.w800, + letterSpacing: -0.48, + ), + subtitle: AppText( + '${medication.doseQuantity!} - ${medication.frequencyString!}', + fontSize: 10, + ), + ); + }).toList()), + ])); } - removeMedication(GetHomeMedicationList medication, SOAPViewModel model) async{ + + removeMedication( + GetHomeMedicationList medication, SOAPViewModel model) async { GifLoaderDialogUtils.showMyDialog(context); - await model.removeCurrentMedication(medication.id!); - await model.getHomeMedication(widget.patientInfo); - GifLoaderDialogUtils.hideDialog(context); + await model.removeCurrentMedication(medication.id!); + await model.getHomeMedication(widget.patientInfo); + GifLoaderDialogUtils.hideDialog(context); } }