From 0780cafcca6c243dfc59b27db481898b8b17ca9e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 28 Jul 2021 14:14:17 +0300 Subject: [PATCH] fixes issues in small devices --- .../assessment/update_assessment_page.dart | 19 +-- .../objective/update_objective_page.dart | 118 +++++++++--------- .../soap_update/plan/update_plan_page.dart | 4 + .../shared_soap_widgets/SOAP_step_header.dart | 6 +- .../bottom_sheet_dialog_button.dart | 12 +- .../bottom_sheet_title.dart | 4 +- .../expandable_SOAP_widget.dart | 2 +- .../steper/steps_widget.dart | 38 +++--- .../profile/patient-profile-app-bar.dart | 2 +- 9 files changed, 110 insertions(+), 95 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index a3c688a4..c4ee046e 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -524,14 +524,17 @@ class _UpdateAssessmentPageState extends State { padding: 10, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - if (mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase.of(context) - .assessmentErrorMsg); - } else { - widget.changeLoadingState(true); - widget.changePageViewIndex(3); - } + + // TODO Elham* + widget.changePageViewIndex(3); + // if (mySelectedAssessmentList.isEmpty) { + // Helpers.showErrorToast( + // TranslationBase.of(context) + // .assessmentErrorMsg); + // } else { + // widget.changeLoadingState(true); + // widget.changePageViewIndex(3); + // } }, ), ), diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 0ecda333..32932d7d 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -104,11 +104,14 @@ class _UpdateObjectivePageState extends State { isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( + physics: ScrollPhysics(), child: Center( child: FractionallySizedBox( widthFactor: 0.9, child: Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ SOAPStepHeader( currentIndex: widget.currentIndex, @@ -269,63 +272,66 @@ class _UpdateObjectivePageState extends State { } submitUpdateObjectivePage(SOAPViewModel model) async { - if (mySelectedExamination.isNotEmpty) { - widget.changeLoadingState(true); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); - mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; - - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); - }); - - if (model.patientPhysicalExamList.isEmpty) { - await model.postPhysicalExam(postPhysicalExamRequestModel); - } else { - await model.patchPhysicalExam(postPhysicalExamRequestModel); - } + // TODO Elham* + widget.changePageViewIndex(2); - if (model.state == ViewState.ErrorLocal) { - widget.changeLoadingState(false); - Helpers.showErrorToast(model.error); - } else { - widget.changeLoadingState(true); - widget.changePageViewIndex(2); - } - } else { - Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); - } + // if (mySelectedExamination.isNotEmpty) { + // widget.changeLoadingState(true); + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // + // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + // PostPhysicalExamRequestModel postPhysicalExamRequestModel = + // new PostPhysicalExamRequestModel(); + // mySelectedExamination.forEach((exam) { + // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + // null) + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = + // []; + // + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM + // .add(ListHisProgNotePhysicalExaminationVM( + // patientMRN: widget.patientInfo.patientMRN, + // episodeId: widget.patientInfo.episodeNo, + // appointmentNo: widget.patientInfo.appointmentNo, + // remarks: exam.remark ?? '', + // createdBy: exam.createdBy ?? doctorProfile.doctorID, + // createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), + // editedBy: doctorProfile.doctorID, + // editedOn: DateTime.now().toIso8601String(), + // examId: exam.selectedExamination.id, + // examType: exam.selectedExamination.typeId, + // isAbnormal: exam.isAbnormal, + // isNormal: exam.isNormal, + // notExamined: exam.notExamined, + // examinationType: exam.isNormal + // ? 1 + // : exam.isAbnormal + // ? 2 + // : 3, + // examinationTypeName: exam.isNormal + // ? "Normal" + // : exam.isAbnormal + // ? 'AbNormal' + // : "Not Examined", + // isNew: exam.isNew)); + // }); + // + // if (model.patientPhysicalExamList.isEmpty) { + // await model.postPhysicalExam(postPhysicalExamRequestModel); + // } else { + // await model.patchPhysicalExam(postPhysicalExamRequestModel); + // } + // + // if (model.state == ViewState.ErrorLocal) { + // widget.changeLoadingState(false); + // Helpers.showErrorToast(model.error); + // } else { + // widget.changeLoadingState(true); + // widget.changePageViewIndex(2); + // } + // } else { + // Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); + // } } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index ce86f33d..a39b7472 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -312,6 +312,10 @@ class _UpdatePlanPageState extends State { ), isExpanded: isProgressExpanded, ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), + ), ], ), ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 7d255c37..deddc4a1 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -19,17 +19,17 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 15,), + SizedBox(height: SizeConfig.isHeightVeryShort?30: 15,), AppText( TranslationBase.of(context).createNew, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4), fontWeight: FontWeight.w700, letterSpacing:-0.72, color: Color(0xFF2E303A), ), AppText(TranslationBase.of(context).episode, - fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 8, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 8), fontWeight: FontWeight.bold, letterSpacing:-1.44, color: Color(0xFF2E303A), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index 30937ab4..835dd225 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -7,8 +7,9 @@ class BottomSheetDialogButton extends StatelessWidget { final Function onTap; final String label; - const BottomSheetDialogButton({Key key, this.onTap, this.label}) - : super(key: key); + double headerHeight = SizeConfig.heightMultiplier * 12; + + BottomSheetDialogButton({Key key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { @@ -20,14 +21,13 @@ class BottomSheetDialogButton extends StatelessWidget { ), border: Border.all(color: HexColor('#EFEFEF'), width: 1), ), - height: SizeConfig.heightMultiplier * 12, + height: headerHeight, width: double.infinity, child: Column( children: [ - SizedBox( - height: 10, - ), Container( + margin: EdgeInsets.only( + top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2)), child: FractionallySizedBox( widthFactor: .80, child: Center( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index 98a457e0..d6c19372 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -8,7 +8,7 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { }) : super(key: key); final String title; - double headerHeight = SizeConfig.getTextMultiplierBasedOnWidth()*35; + double headerHeight = SizeConfig.heightMultiplier*15; @override Widget build(BuildContext context) { return Container( @@ -63,5 +63,5 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { } @override - Size get preferredSize => Size(double.maxFinite,115); + Size get preferredSize => Size(double.maxFinite,headerHeight); } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 732df855..c1b2d443 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -42,7 +42,7 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ AppText(headerTitle, variant: isExpanded ? "bodyText" : '', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: 5), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), letterSpacing:-0.64, fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index e1f740bc..88ca392b 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -18,13 +18,15 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - double containerHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); + double circleHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); double circleTop = (SizeConfig.isHeightVeryShort ?12:SizeConfig.isHeightShort?10:10); + double containerHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?16:15); + return !projectViewModel.isArabic ? Stack( children: [ Container( - height: height == 0 ? 100 : height, + height: height == 0 ? containerHeight : height, width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, ), @@ -53,8 +55,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -103,8 +105,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: containerHeight, - height: containerHeight, + width: circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -157,8 +159,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -206,8 +208,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -280,8 +282,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -329,8 +331,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -378,8 +380,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -429,8 +431,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 0b94ec23..1486edc5 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -552,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?150:SizeConfig.isHeightShort?180: 170 + ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?137:SizeConfig.isHeightShort?180: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge?25:20) : height); }