From 6b65de77e90d496cb861f069c9fc8371f0faaddd Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 27 Jul 2021 17:57:48 +0300 Subject: [PATCH] fix design issues on diff pages inside soap --- .../assessment/update_assessment_page.dart | 9 +- .../objective/add_examination_page.dart | 2 +- .../subjective/allergies/add_allergies.dart | 2 +- .../history/add_history_dialog.dart | 2 +- .../subjective/medication/add_medication.dart | 2 +- .../soap_update/update_soap_index.dart | 111 ++++++++---------- .../profile/patient-profile-app-bar.dart | 72 ++++++------ .../shared/dialogs/master_key_dailog.dart | 49 ++++---- 8 files changed, 127 insertions(+), 122 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 99c27478..a3c688a4 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 @@ -482,7 +482,8 @@ class _UpdateAssessmentPageState extends State { ), border: Border.all(color: HexColor('#707070'), width: 0), ), - height: 80, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), width: double.infinity, child: Column( children: [ @@ -500,6 +501,9 @@ class _UpdateAssessmentPageState extends State { title: TranslationBase.of(context).previous, color: Colors.grey[300], fontColor: Colors.black, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, fontWeight: FontWeight.w600, disabled: model.state == ViewState.BusyLocal, onPressed: () async { @@ -515,6 +519,9 @@ class _UpdateAssessmentPageState extends State { title: TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, disabled: model.state == ViewState.BusyLocal, onPressed: () async { if (mySelectedAssessmentList.isEmpty) { diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index f1966130..5ce4250a 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -102,7 +102,7 @@ class _AddExaminationPageState extends State { ), ], ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 7f1abb64..8c68a61e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -116,7 +116,7 @@ class _AddAllergiesState extends State { ]), ), ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index c089bd24..f663d92e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -163,7 +163,7 @@ class _AddHistoryDialogState extends State { ], )), ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 6b0a592d..d5addf88 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -414,7 +414,7 @@ class _AddMedicationState extends State { ]), ), ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index d2fefb31..792a3f20 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -62,68 +62,61 @@ class _UpdateSoapIndexState extends State PatiantInformtion patient = routeArgs['patient']; return AppScaffold( isLoading: _isLoading, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - boxShadow: [], - color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientProfileAppBar(patient), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ - Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.73, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState) - ], - ), - ) - ], - ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.73, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState) + ], + ), + ) + ], ), - ], - ), + ), + ], ), ), ); diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 2a0fa072..0b94ec23 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -75,21 +75,17 @@ class PatientProfileAppBar extends StatelessWidget ), decoration: BoxDecoration( color: Colors.white, + border: Border( bottom: BorderSide(color:Color(0xFFEFEFEF))) + ), - // height: height == 0 - // ? isInpatient - // ? 215 - // : isAppointmentHeader - // ? 325 - // : 200 - // : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + + margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort?30: 50), child: Column( children: [ Container( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -138,10 +134,10 @@ class PatientProfileAppBar extends StatelessWidget ), Row(children: [ Padding( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0), child: Container( - width: 60, - height: 60, + width: SizeConfig.getTextMultiplierBasedOnWidth()*20, + height: SizeConfig.getTextMultiplierBasedOnWidth()*20, child: Image.asset( gender == 1 ? 'assets/images/male_avatar.png' @@ -170,14 +166,14 @@ class PatientProfileAppBar extends StatelessWidget color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ) : AppText( TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ), patient.startTime != null ? AppText( @@ -185,7 +181,7 @@ class PatientProfileAppBar extends StatelessWidget ? patient.startTime : '', fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A)) : SizedBox() ], @@ -207,7 +203,7 @@ class PatientProfileAppBar extends StatelessWidget .fileNumber, style: TextStyle( - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF575757), fontWeight: FontWeight.w600, @@ -218,7 +214,7 @@ class PatientProfileAppBar extends StatelessWidget style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 12, color: Color(0xFF2E303A),)), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),)), ], ), ), @@ -227,7 +223,7 @@ class PatientProfileAppBar extends StatelessWidget AppText( patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ), patient.nationalityFlagURL != null ? ClipRRect( @@ -260,7 +256,7 @@ class PatientProfileAppBar extends StatelessWidget text: TranslationBase .of(context) .age + " : ", - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), + style: TextStyle(fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), new TextSpan( text: "${AppDateUtils.getAgeByBirthday( @@ -271,7 +267,7 @@ class PatientProfileAppBar extends StatelessWidget isServerFormat: !isFromLiveCare)}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),)), ], ), @@ -285,7 +281,7 @@ class PatientProfileAppBar extends StatelessWidget AppText( TranslationBase.of(context).appointmentDate + " : ", - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, color: Color(0xFF575757), fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -300,7 +296,7 @@ class PatientProfileAppBar extends StatelessWidget patient.appointmentDate)) , fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A), ), SizedBox( @@ -319,7 +315,7 @@ class PatientProfileAppBar extends StatelessWidget children: [ new TextSpan( text: "Result Date: ", - style: TextStyle( fontSize: 10, + style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, color: Color(0xFF575757), fontWeight: FontWeight.w600, fontFamily: 'Poppins',)), @@ -341,7 +337,7 @@ class PatientProfileAppBar extends StatelessWidget child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757), fontFamily: 'Poppins', ), children: [ @@ -363,7 +359,7 @@ class PatientProfileAppBar extends StatelessWidget .toString())))}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),)), ]))), if (patient.admissionDate != null) @@ -371,7 +367,7 @@ class PatientProfileAppBar extends StatelessWidget children: [ AppText( "${TranslationBase.of(context).numOfDays}: ", - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757) + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757) ), if(isDischargedPatient && patient.dischargeDate != null) @@ -384,7 +380,7 @@ class PatientProfileAppBar extends StatelessWidget patient.admissionDate)) .inDays + 1}", fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A), ) else @@ -396,7 +392,7 @@ class PatientProfileAppBar extends StatelessWidget patient.admissionDate)) .inDays + 1}", fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),), ], ), @@ -457,7 +453,7 @@ class PatientProfileAppBar extends StatelessWidget .dr}$doctorName', color: Color(0xFF2E303A), fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ), if (orderNo != null && !isPrescriptions) @@ -465,7 +461,7 @@ class PatientProfileAppBar extends StatelessWidget children: [ AppText('Order No: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(orderNo ?? '', fontSize: 12) ], @@ -475,7 +471,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Invoice: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(invoiceNO ?? "", fontSize: 12) ], @@ -484,7 +480,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Branch: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(branch ?? '', fontSize: 12) ], @@ -494,7 +490,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Clinic: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(clinic ?? '', fontSize: 12) ], @@ -504,7 +500,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Episode: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(episode ?? '', fontSize: 12) ], @@ -514,7 +510,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Visit Date: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(visitDate ?? '', fontSize: 12) ], @@ -527,7 +523,7 @@ class PatientProfileAppBar extends StatelessWidget !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757), ), AppText( '${AppDateUtils @@ -535,7 +531,7 @@ class PatientProfileAppBar extends StatelessWidget appointmentDate, isArabic: projectViewModel .isArabic)}', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ) ], ) @@ -556,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : 170 + ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?150:SizeConfig.isHeightShort?180: 170 : height); } diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 55046c3c..7beb3ca6 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -1,9 +1,12 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../app_texts_widget.dart'; + // ignore: must_be_immutable class MasterKeyDailog extends StatefulWidget { final List list; @@ -33,18 +36,18 @@ class _MasterKeyDailogState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return showAlertDialog(context, projectViewModel); + return showAlertDialog(context, projectViewModel); } showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( - child: Text(this.widget.okText), + child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,), onPressed: () { this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); @@ -69,23 +72,29 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: Text( - '${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), - groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), - value: widget.isICD ? widget.selectedValue.code.toString() : item - .id.toString(), - activeColor: Colors.blue.shade700, - selected: widget.isICD ? item.code.toString() == - widget.selectedValue.code.toString() : item.id.toString() == - widget.selectedValue.id.toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) + title: AppText( + '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + + (widget.isICD ? '/${item.code}' : ''), + + ), + groupValue: widget.isICD + ? widget.selectedValue.code.toString() + : widget.selectedValue.id.toString(), + value: widget.isICD + ? widget.selectedValue.code.toString() + : item.id.toString(), + activeColor: Colors.blue.shade700, + selected: widget.isICD + ? item.code.toString() == + widget.selectedValue.code.toString() + : item.id.toString() == + widget.selectedValue.id.toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) .toList() ], ),