From 7f440a2d8acba4b4f7d6471817267b8888f8257c Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 7 Apr 2021 18:56:00 +0300 Subject: [PATCH] fix soap screen height --- .../patient-profile-header-new-design.dart | 5 +- .../profile/soap_update/steps_widget.dart | 7 +- .../soap_update/update_soap_index.dart | 160 ++++++++---------- 3 files changed, 78 insertions(+), 94 deletions(-) diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 1716c7ee..922b1fe1 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -14,9 +14,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; + final double height; PatientProfileHeaderNewDesign( - this.patient, this.patientType, this.arrivalType); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); @override Widget build(BuildContext context) { @@ -36,7 +37,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, ), - height: 200, + height: height == 0 ? 200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 88c47706..2e2c77c0 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -9,8 +9,9 @@ import 'package:provider/provider.dart'; class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; + final double height; - StepsWidget({Key key, this.index, this.changeCurrentTab}); + StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); // TODO : Add translation to name @override @@ -20,7 +21,7 @@ class StepsWidget extends StatelessWidget { ? Stack( children: [ Container( - height: 150, + height: height == 0 ? 150 : height, width: MediaQuery.of(context).size.width, color: Colors.transparent, child: Center( @@ -243,7 +244,7 @@ class StepsWidget extends StatelessWidget { : Stack( children: [ Container( - height: 150, + height: height == 0 ? 150 : height, width: MediaQuery .of(context) .size 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 66487a6e..b14a0479 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -35,7 +35,9 @@ class _UpdateSoapIndexState extends State List mySelectedExamination = List(); List mySelectedAssessment = List(); - GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); + GetPatientProgressNoteResModel patientProgressNote = + GetPatientProgressNoteResModel(); + changePageViewIndex(pageIndex) { if (pageIndex != _currentIndex) changeLoadingState(true); _controller.jumpToPage(pageIndex); @@ -67,96 +69,76 @@ class _UpdateSoapIndexState extends State isLoading: _isLoading, isShowAppBar: false, // appBarTitle: TranslationBase.of(context).healthRecordInformation, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - boxShadow: [], - color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - // PatientPageHeaderWidget(patient), - PatientProfileHeaderNewDesign(patient, '7', '7'), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + // TODO mousa removed the singleChildScrollView + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + // PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign(patient, '7', '7', height: MediaQuery.of(context).size.height * 0.28,), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + margin: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + height: MediaQuery.of(context).size.height * 0.21, ), - FractionallySizedBox( - child: SingleChildScrollView( - child: Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.75, - child: Column( - children: [ - Container( - margin: EdgeInsets.only( - left: MediaQuery.of(context).size.width * - 0.05, - right: MediaQuery.of(context).size.width * - 0.05), - child: StepsWidget( - index: _currentIndex, - changeCurrentTab: changePageViewIndex, - ), - ), - Expanded( - child: PageView( - - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState: changeLoadingState - ), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - mySelectedExamination: - mySelectedExamination, - patientInfo: patient, - changeLoadingState: changeLoadingState - ), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - mySelectedAssessmentList: - mySelectedAssessment, - patientInfo: patient, - changeLoadingState: changeLoadingState - - ), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - patientInfo: patient, - patientProgressNote: patientProgressNote, - changeLoadingState: changeLoadingState - - ) - ], - ), - ), - ], - ), - ), - ), - ) - ], - ), + ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.50, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + mySelectedExamination: mySelectedExamination, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + mySelectedAssessmentList: mySelectedAssessment, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + patientInfo: patient, + patientProgressNote: patientProgressNote, + changeLoadingState: changeLoadingState) + ], + ), + ) + ], ), - ], - ), + ), + ], ), ), );