From 3a734f4718eb38fe2c6d2d13ba64bea977d3aafe Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 12 Apr 2021 16:21:58 +0300 Subject: [PATCH] finish the new design on the progress note (SOAP) --- .../profile/soap_update/update_plan_page.dart | 16 +++++++++------- .../profile/soap_update/update_soap_index.dart | 8 ++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index de6f740d..e965d482 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -62,14 +62,13 @@ class _UpdatePlanPageState extends State { )), ); } - TextEditingController typeController = TextEditingController(); @override void initState() { super.initState(); if(widget.patientProgressNote.planNote !=null ){ setState(() { - isAddProgress = true; + isAddProgress = false; }); } } @@ -94,7 +93,9 @@ class _UpdatePlanPageState extends State { widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; - + setState(() { + isAddProgress = false; + }); } widget.changeLoadingState(false); }, @@ -195,7 +196,7 @@ class _UpdatePlanPageState extends State { children: [ Expanded( child: Texts( - progressNoteController.text+"asdasd sdakfjhg gfadsfg dashkfgasd hgd sfnbsd,fbnsdafbasdnzb", + progressNoteController.text, fontSize: 10, ), @@ -204,6 +205,7 @@ class _UpdatePlanPageState extends State { onTap: (){ setState(() { isAddProgress = true; + widget.changePageViewIndex(3,isChangeState:false); }); }, child: Icon(DoctorApp.edit,size: 18,)) @@ -266,10 +268,10 @@ class _UpdatePlanPageState extends State { widget.patientProgressNote.planNote = progressNoteController.text; isAddProgress = !isAddProgress; }); + submitPlan(model); } else{ - var asd =""; - // submitPlan(model); + Navigator.of(context).pop(); } }, ), @@ -309,7 +311,7 @@ class _UpdatePlanPageState extends State { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } else { - Navigator.of(context).pop(); + widget.changePageViewIndex(4,isChangeState:false); } } else { helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 0c69d71d..fa4631aa 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -38,9 +38,13 @@ class _UpdateSoapIndexState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - changePageViewIndex(pageIndex) { - if (pageIndex != _currentIndex) changeLoadingState(true); + changePageViewIndex(pageIndex,{isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) + changeLoadingState(true); _controller.jumpToPage(pageIndex); + setState(() { + _currentIndex = pageIndex; + }); } bool _isLoading = true;