diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8766832a..6500c10e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -282,7 +282,7 @@ const Map> localizedValues = { 'indication': {'en': 'Indication', 'ar': 'دواعي الاستخدام'}, 'duration': {'en': 'Duration', 'ar': 'المدة الزمنية'}, 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, - 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, + 'addMedication': {'en': 'Add Medication', 'ar': 'اضف الدواء'}, 'route': {'en': 'Route', 'ar': 'المسار'}, 'reschedule-leave': {'en': 'Reschedule and leaves', 'ar': 'إعادة الجدولة والأوراق'}, 'no-reschedule-leave': {'en': 'No Reschedule and leaves', 'ar': 'لا إعادة جدولة ويغادر'}, diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6ba584c6..abb3ddd6 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -17,15 +17,31 @@ class SizeConfig { static bool isPortrait = true; static bool isMobilePortrait = false; static bool isMobile = false; - + static bool isHeightShort = false; + static bool isHeightVeryShort = false; + static bool isHeightMiddle = false; + static bool isHeightLarge = false; + static bool isWidthLarge = false; void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; - - if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } + if (constraints.maxHeight < 600) { + isHeightVeryShort = true; + } else if (constraints.maxHeight < 800) { + isHeightShort = true; + } else if (constraints.maxHeight < 1000) { + isHeightMiddle = true; + } else { + isHeightLarge = true; + } + + if (constraints.maxWidth > 600) { + isWidthLarge = true; + } + if (orientation == Orientation.portrait) { isPortrait = true; if (realScreenWidth < 450) { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index cae415da..6e075bc2 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -254,7 +254,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // DrAppToastMsg.showSuccesToast("_VerificationCode_ : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index c4587014..67d06852 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -71,321 +71,323 @@ class _VerificationMethodsScreenState extends State { margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), height: SizeConfig.realScreenHeight * .95, width: SizeConfig.realScreenWidth, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SizedBox( - height: 80, - ), - if(authenticationViewModel.isFromLogin) - InkWell( - onTap: (){ - authenticationViewModel.setUnverified(false,isFromLogin: false); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, - child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - - ), - Container( - - child: Column( - children: [ - SizedBox( - height: 20, - ), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - AppText( - TranslationBase.of(context).welcomeBack, - fontSize:12, - fontWeight: FontWeight.w700, - color: Color(0xFF2B353E), - ), - AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), - fontSize: 24, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context).accountInfo , - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 20, - ), - Container( - padding: EdgeInsets.all(15), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - - Text( - TranslationBase.of(context) - .lastLoginAt, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700,), - - ), - Row( - children: [ - AppText( - TranslationBase - .of(context) - .verifyWith, - fontSize: 14, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - AppText( - authenticationViewModel.getType( - authenticationViewModel.user - .logInTypeID, - context), - fontSize: 14, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ) - ], - crossAxisAlignment: CrossAxisAlignment.start,), - Column(children: [ - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 13, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - ), - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SizedBox( + height: 80, + ), + if(authenticationViewModel.isFromLogin) + InkWell( + onTap: (){ + authenticationViewModel.setUnverified(false,isFromLogin: false); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - ) - ], - ), - ), - SizedBox( - height: 20, - ), - Row( - children: [ - AppText( - "Please Verify", - fontSize: 16, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ) - ], - ) - : Column( + ), + Container( + + child: Column( + children: [ + SizedBox( + height: 20, + ), + authenticationViewModel.user != null && isMoreOption == false + ? Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - this.onlySMSBox == false - ? Container( - margin: EdgeInsets.only(bottom: 20, top: 30), - child: AppText( - TranslationBase.of(context) - .verifyLoginWith, - fontSize: 18, - color: Color(0xFF2E303A), + + AppText( + TranslationBase.of(context).welcomeBack, + fontSize:12, + fontWeight: FontWeight.w700, + color: Color(0xFF2B353E), + ), + AppText( + Helpers.capitalize(authenticationViewModel.user.doctorName), + fontSize: 24, + color: Color(0xFF2B353E), fontWeight: FontWeight.bold, - textAlign: TextAlign.left, ), - ) - : AppText( - TranslationBase.of(context) - .verifyFingerprint2, - fontSize: - SizeConfig.textMultiplier * 2.5, - textAlign: TextAlign.start, + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).accountInfo , + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 20, + ), + Container( + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + + Text( + TranslationBase.of(context) + .lastLoginAt, + overflow: + TextOverflow.ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700,), + + ), + Row( + children: [ + AppText( + TranslationBase + .of(context) + .verifyWith, + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + AppText( + authenticationViewModel.getType( + authenticationViewModel.user + .logInTypeID, + context), + fontSize: 14, + color: Color(0xFF2B353E), + + fontWeight: FontWeight.w700, + ), + ], + ) + ], + crossAxisAlignment: CrossAxisAlignment.start,), + Column(children: [ + AppText( + authenticationViewModel.user.editedOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + authenticationViewModel.user + .editedOn)) + : authenticationViewModel.user.createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate(authenticationViewModel.user + .createdOn)) + : '--', + textAlign: + TextAlign.right, + fontSize: 13, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + ), + AppText( + authenticationViewModel.user.editedOn != + null + ? AppDateUtils.getHour( + AppDateUtils.convertStringToDate( + authenticationViewModel.user + .editedOn)) + : authenticationViewModel.user.createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils.convertStringToDate(authenticationViewModel.user + .createdOn)) + : '--', + textAlign: + TextAlign.right, + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + + ) + ], + ), + ), + SizedBox( + height: 20, ), - ]), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ Row( + children: [ + AppText( + "Please Verify", + fontSize: 16, + color: Color(0xFF2B353E), + + fontWeight: FontWeight.w700, + ), + ], + ) + ], + ) + : Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + this.onlySMSBox == false + ? Container( + margin: EdgeInsets.only(bottom: 20, top: 30), + child: AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: 18, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + textAlign: TextAlign.left, + ), + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: + SizeConfig.textMultiplier * 2.5, + textAlign: TextAlign.start, + ), + ]), + authenticationViewModel.user != null && isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => + { + // TODO check this logic it seem it will create bug to us + authenticateUser( + AuthMethodTypes + .Fingerprint, true) + }, + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: SelectedAuthMethodTypesService + .getMethodsTypeService( + authenticationViewModel.user + .logInTypeID), + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )), + ), + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.MoreOptions, + onShowMore: () { + setState(() { + isMoreOption = true; + }); + }, + )) + ]), + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: InkWell( - onTap: () => - { - // TODO check this logic it seem it will create bug to us - authenticateUser( - AuthMethodTypes - .Fingerprint, true) - }, - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: SelectedAuthMethodTypesService - .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - ), + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.Fingerprint, + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )), Expanded( child: VerificationMethodsList( authenticationViewModel:authenticationViewModel, authMethodType: - AuthMethodTypes.MoreOptions, - onShowMore: () { - setState(() { - isMoreOption = true; - }); - }, + AuthMethodTypes.FaceID, + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), )) - ]), - ]) - : Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.Fingerprint, - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.FaceID, - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: AuthMethodTypes - .SMS, - authenticateUser: - ( - AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.WhatsApp, - authenticateUser: - ( - AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )) - ], - ), - ]), + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: AuthMethodTypes + .SMS, + authenticateUser: + ( + AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )), + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.WhatsApp, + authenticateUser: + ( + AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )) + ], + ), + ]), - // ) - ], + // ) + ], + ), ), - ), - ], + ], + ), ), ), ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index d0819b76..6449913c 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -35,14 +36,14 @@ class SOAPOpenItems extends StatelessWidget { children: [ AppText( "$label", - fontSize:15, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4.5, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), letterSpacing:-0.44 , ), AppText( "${TranslationBase.of(context).searchHere}", - fontSize:14, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*3.5, fontWeight: FontWeight.w500, color: Color(0xFF575757), letterSpacing:-0.56 , 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 5052d48f..7d255c37 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 @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -21,14 +22,14 @@ class SOAPStepHeader extends StatelessWidget { SizedBox(height: 15,), AppText( TranslationBase.of(context).createNew, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, fontWeight: FontWeight.w700, letterSpacing:-0.72, color: Color(0xFF2E303A), ), AppText(TranslationBase.of(context).episode, - fontSize: 24, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 8, fontWeight: FontWeight.bold, letterSpacing:-1.44, color: Color(0xFF2E303A), @@ -41,7 +42,8 @@ class SOAPStepHeader extends StatelessWidget { ), ), SizedBox( - height: 30, + height:SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 1 : 2), ), ], ); 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 d6cab800..30937ab4 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 @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -19,7 +20,7 @@ class BottomSheetDialogButton extends StatelessWidget { ), border: Border.all(color: HexColor('#EFEFEF'), width: 1), ), - height: MediaQuery.of(context).size.height * 0.1, + height: SizeConfig.heightMultiplier * 12, width: double.infinity, child: Column( children: [ @@ -31,6 +32,8 @@ class BottomSheetDialogButton extends StatelessWidget { widthFactor: .80, child: Center( child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), title: label, padding: 10, color: Color(0xFF359846), 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 d8110844..98a457e0 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 @@ -1,58 +1,62 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { - const BottomSheetTitle({ + BottomSheetTitle({ Key key, this.title, }) : super(key: key); final String title; + double headerHeight = SizeConfig.getTextMultiplierBasedOnWidth()*35; @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), + // padding: EdgeInsets.only( + // left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), - height: 115, - child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), - margin: EdgeInsets.only(top: 60), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize:20, - color: Colors.black), - children: [ - new TextSpan( + height: headerHeight, + child: Center( + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: headerHeight *0.5), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( - text: title, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 22)), - ], + text: title, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), + ], + ), ), - ), - InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Icon(DoctorApp.close_1, - size:20, - color: Color(0xFF2B353E))) - ], - ), - ], + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(DoctorApp.close_1, + size:SizeConfig.getTextMultiplierBasedOnWidth()*5, + color: Color(0xFF2B353E))) + ], + ), + ], + ), ), ), ); 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 2dcce4ae..25518110 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 @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -19,7 +20,7 @@ class ExpandableSOAPWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.symmetric(vertical: 20, horizontal: 10), + padding: EdgeInsets.symmetric(vertical: SizeConfig.isHeightVeryShort ?10:20, horizontal: 10), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -41,14 +42,14 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ AppText(headerTitle, variant: isExpanded ? "bodyText" : '', - fontSize: 16, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*5, letterSpacing:-0.64, fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), if(isRequired) Icon( FontAwesomeIcons.asterisk, - size: 12, + size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, ) ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart index a6c5c22b..10562d53 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart @@ -39,7 +39,7 @@ class StatusLabel extends StatelessWidget { : TranslationBase.of(context).locked, fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < selectedStepId 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 304a6765..cba8daf2 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 @@ -20,6 +20,8 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + double containerHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); + double circleTop = (SizeConfig.isHeightVeryShort ?12:SizeConfig.isHeightShort?10:10); return !projectViewModel.isArabic ? Stack( children: [ @@ -45,7 +47,7 @@ class StepsWidget extends StatelessWidget { ), ),), Positioned( - top: 10, + top: circleTop, left: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -53,8 +55,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -92,7 +94,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, left: MediaQuery .of(context) .size @@ -103,8 +105,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width: containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -144,7 +146,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, left: MediaQuery .of(context) .size @@ -157,8 +159,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -198,7 +200,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, right: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -206,8 +208,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -272,7 +274,7 @@ class StepsWidget extends StatelessWidget { ), ),), Positioned( - top: 10, + top: circleTop, right: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -280,8 +282,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -318,7 +320,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, right: MediaQuery .of(context) .size @@ -329,8 +331,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -367,7 +369,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, right: MediaQuery .of(context) .size @@ -378,8 +380,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -421,7 +423,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, left: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -429,8 +431,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 00606f68..579d8153 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -1,7 +1,9 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; @@ -73,7 +75,7 @@ class _AddAllergiesItemState extends State { onTapItem(); }), InkWell( - onTap:onTapItem, + onTap: onTapItem, child: Container( child: AppText( projectViewModel.isArabic @@ -82,8 +84,7 @@ class _AddAllergiesItemState extends State { : widget.item.nameEn : widget.item.nameEn, color: Color(0xFF575757), - fontSize: 14, - fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.8, letterSpacing: -0.56, ), width: MediaQuery.of(context).size.width * 0.55, @@ -92,22 +93,22 @@ class _AddAllergiesItemState extends State { ], ), InkWell( - onTap: () { - if (mySelectedAllergy != null) { - setState(() { - mySelectedAllergy.isExpanded = - mySelectedAllergy.isExpanded ? false : true; - }); - } - }, - child: Icon((mySelectedAllergy != null - ? mySelectedAllergy.isExpanded - : false) - + onTap: () { + if (mySelectedAllergy != null) { + setState(() { + mySelectedAllergy.isExpanded = + mySelectedAllergy.isExpanded ? false : true; + }); + } + }, + child: Icon( + (mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false) ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline, - color: Color(0xFF575757) , - ),) + color: Color(0xFF575757), + size: 20, + ), + ) ], ), bodyWidget: Center( @@ -143,8 +144,9 @@ class _AddAllergiesItemState extends State { isTextFieldHasSuffix: true, hintText: TranslationBase.of(context).selectSeverity + "*", enabled: false, - maxLines: 2, - minLines: 2, + maxLines: 1, + minLines: 1, + height: Helpers.getTextFieldHeight(), validationError: mySelectedAllergy != null && mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.hasValidationError @@ -161,11 +163,10 @@ class _AddAllergiesItemState extends State { maxLines: 25, minLines: 3, hasBorder: true, - onChanged: (value){ + onChanged: (value) { mySelectedAllergy.remark = value; }, inputType: TextInputType.multiline, - ), SizedBox( height: 10, @@ -180,18 +181,18 @@ class _AddAllergiesItemState extends State { ); } - onTapItem(){ + onTapItem() { setState(() { if (widget.isServiceSelected(widget.item)) { widget.removeAllergy(widget.item); } else { MySelectedAllergy mySelectedAllergy = - SoapUtils.generateMySelectedAllergy( - allergy: widget.item, - allergySeverity: _selectedAllergySeverity, - remark: null, - isChecked: true, - isExpanded: true); + SoapUtils.generateMySelectedAllergy( + allergy: widget.item, + allergySeverity: _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); widget.addAllergy(mySelectedAllergy); } }); diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 3f6f694f..8819f04a 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -58,7 +59,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState children: [ Expanded( child: Container( - height: MediaQuery.of(context).size.height * 0.70, + height: Helpers.getTextFieldHeight(), child: Center( child: Container( decoration: BoxDecoration( diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index ac6ec2c5..305b0c65 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -67,8 +68,7 @@ class _PriorityBarState extends State { : item, textAlign: TextAlign.center, style: TextStyle( - fontSize: 14, - + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, color: Colors.black, fontWeight: FontWeight.bold, ), 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 c80251f8..8bc8e712 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 @@ -1,5 +1,6 @@ // ignore: must_be_immutable import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; @@ -8,6 +9,7 @@ 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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -53,7 +55,6 @@ class _AddMedicationState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final screenSize = MediaQuery.of(context).size; return FractionallySizedBox( child: BaseView( onModelReady: (model) async { @@ -75,340 +76,367 @@ class _AddMedicationState extends State { await model.getMedicationList(); }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addMedication, - ), - body: Center( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( + baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addMedication, + ), + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Expanded( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 16, - ), - Container( - // height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null + child: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?2:SizeConfig.isHeightShort?2:2), + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + _selectedMedication == null, + child: AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + TranslationBase.of( + context) + .searchMedicineNameHere, + null, + true, + suffixIcon: + Icons.search), + itemSubmitted: (item) => + setState(() => + _selectedMedication = + item), + key: key, + suggestions: + model.allMedicationList, + itemBuilder: (context, + suggestion) => + new Padding( + child: AppText(suggestion + .description + + '/' + + suggestion + .genericName), + padding: + EdgeInsets.all( + 8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, + input) => + suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith(input + .toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith(input + .toLowerCase()), + ), + ) + : AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: _selectedMedication != + null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of( + context) + .searchMedicineNameHere, + minLines: 1, + maxLines: 1, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: model.medicationDoseTimeList != + null ? () { - setState(() { - _selectedMedication = null; - }); + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationDoseTimeList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: + _selectedMedicationDose, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = + selectedValue; + + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); } : null, - child: _selectedMedication == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - _selectedMedication == null, - child: AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .searchMedicineNameHere, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState( - () => _selectedMedication = - item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: AppText(suggestion - .description + - '/' + - suggestion - .genericName), - padding: - EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input - .toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith( - input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - hintText: _selectedMedication != - null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of(context) - .searchMedicineNameHere, - minLines: 2, - maxLines: 2, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), - enabled: false, - ), + hintText: + TranslationBase.of(context).doseTime, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && + _selectedMedicationDose == null + ? TranslationBase.of(context) + .emptyMessage + : null, ), - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - onClick: model.medicationDoseTimeList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: - TranslationBase.of(context).ok, - selectedValue: _selectedMedicationDose, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationStrengthList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: + _selectedMedicationStrength, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - doseController - .text = projectViewModel - .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).doseTime, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && - _selectedMedicationDose == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationStrengthList, - okText: - TranslationBase.of(context).ok, - selectedValue: _selectedMedicationStrength, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).strength, + maxLines: 1, + minLines: 1, + controller: strengthController, + validationError: isFormSubmitted && + _selectedMedicationStrength == + null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + selectedValue: + _selectedMedicationRoute, + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - strengthController - .text = projectViewModel - .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).strength, - maxLines: 2, - minLines: 2, - controller: strengthController, - validationError: isFormSubmitted && - _selectedMedicationStrength == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationRouteList, - selectedValue: _selectedMedicationRoute, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).route, + maxLines: 1, + minLines: 1, + controller: routeController, + validationError: isFormSubmitted && + _selectedMedicationRoute == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.medicationFrequencyList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationFrequencyList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: + _selectedMedicationFrequency, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; - routeController - .text = projectViewModel - .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 2, - minLines: 2, - controller: routeController, - validationError: isFormSubmitted && - _selectedMedicationRoute == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - onClick: model.medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationFrequencyList, - okText: - TranslationBase.of(context).ok, - selectedValue: _selectedMedicationFrequency, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).frequency, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && + _selectedMedicationFrequency == + null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + ), - frequencyController - .text = projectViewModel - .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).frequency, - enabled: false, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && - _selectedMedicationFrequency == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 30, - ), - ], + ], + ), )), ), - ), - ]), + ]), + ), ), - ), - bottomSheet:model.state == ViewState.Busy?Container(height: 0,): - BottomSheetDialogButton( - label: TranslationBase.of(context) - .addMedication - .toUpperCase(), - onTap: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; - Navigator.of(context).pop(); - } - }, - ) - ), + bottomSheet: model.state == ViewState.Busy + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: + TranslationBase.of(context).addMedication, + onTap: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget + .medicationController.text + + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, + )), ), ); } diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 5942a7cf..3e8c2d44 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -268,7 +269,8 @@ class _UpdateSubjectivePageState extends State { isExpanded: isChiefExpand, ), SizedBox( - height: 30, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 4 : 2), ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).histories, @@ -286,7 +288,8 @@ class _UpdateSubjectivePageState extends State { isExpanded: isHistoryExpand, ), SizedBox( - height: 30, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 4 : 2), ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).allergiesSoap, @@ -309,7 +312,8 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height: MediaQuery.of(context).size.height * 0.16, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -324,7 +328,8 @@ class _UpdateSubjectivePageState 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: [ @@ -338,7 +343,10 @@ class _UpdateSubjectivePageState extends State { child: AppButton( title: TranslationBase.of(context).next, fontWeight: FontWeight.w600, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), color: Colors.red[700], + padding: 10, // loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 7232f0c9..f8f0fbd3 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -277,4 +277,7 @@ class Helpers { String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } + static double getTextFieldHeight(){ + return SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?10:SizeConfig.isHeightShort?8:6); + } } diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index ed3e6e98..acbd27fe 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -22,6 +22,7 @@ class AppButton extends StatefulWidget { final double radius; final double vPadding; final double hPadding; + final double height; AppButton({ @required this.onPressed, @@ -40,6 +41,7 @@ class AppButton extends StatefulWidget { this.radius = 8.0, this.hasBorder = false, this.borderColor, + this.height, }); _AppButtonState createState() => _AppButtonState(); @@ -50,6 +52,7 @@ class _AppButtonState extends State { Widget build(BuildContext context) { return Container( // height: MediaQuery.of(context).size.height * 0.075, + height: widget.height, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 780f82ca..8e383ab9 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -1,6 +1,8 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/cupertino.dart'; @@ -75,7 +77,7 @@ class _MasterKeyCheckboxSearchWidgetState child: ListView( children: [ AppTextFieldCustom( - height: MediaQuery.of(context).size.height * 0.070, + height: Helpers.getTextFieldHeight(),//MediaQuery.of(context).size.height * 0.070, hintText: TranslationBase.of(context).searchHistory, isTextFieldHasSuffix: true, hasBorder: false, @@ -133,8 +135,7 @@ class _MasterKeyCheckboxSearchWidgetState : historyInfo.nameEn, color: Color(0xFF575757), - fontSize: 14, - fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.8, letterSpacing: -0.56, ), ), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 05f139a2..bbd010cd 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -158,7 +158,7 @@ class _AppTextFieldCustomState extends State { ? widget.inputFormatters : [], onChanged: (value) { - // setState(() {}); + setState(() {}); if (widget.onChanged != null) { widget.onChanged(value); }