From 837ff69c8259c44ef672f2884f8c992ff7930087 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 23 May 2021 16:33:20 +0300 Subject: [PATCH 01/42] fix design --- lib/screens/auth/login_screen.dart | 299 ++++----- .../auth/verification_methods_screen.dart | 579 +++++++++--------- lib/widgets/auth/method_type_card.dart | 4 +- lib/widgets/auth/sms-popup.dart | 401 ++++++------ 4 files changed, 619 insertions(+), 664 deletions(-) diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 9563b29c..9eccd1c1 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -2,14 +2,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -26,7 +23,6 @@ class _LoginScreenState extends State { String platformImei; bool allowCallApi = true; - //TODO change AppTextFormField to AppTextFormFieldCustom final loginFormKey = GlobalKey(); var projectIdController = TextEditingController(); var userIdController = TextEditingController(); @@ -42,176 +38,146 @@ class _LoginScreenState extends State { return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), - body: SafeArea( - child: ListView(children: [ - Container( + body: SingleChildScrollView( + child: SafeArea( + child: Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - //TODO Use App Text rather than text - Container( - - child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + //TODO Use App Text rather than text + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + SizedBox( + height: 30, + ), + ], + ), + Column( crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - SizedBox( - height: 30, - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, children: [ - SizedBox( - height: 10, - ), - Text( - TranslationBase - .of(context) - .welcomeTo, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight - .w600, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase - .of(context) - .drSulaimanAlHabib, - style: TextStyle( - color:Color(0xFF2B353E), - fontWeight: FontWeight - .bold, - fontSize: SizeConfig - .isMobile - ? 24 - : SizeConfig - .realScreenWidth * - 0.029, - fontFamily: 'Poppins'), - ), + .start, children: [ + SizedBox( + height: 10, + ), + Text( + TranslationBase + .of(context) + .welcomeTo, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight + .w600, + fontFamily: 'Poppins'), + ), + Text( + TranslationBase + .of(context) + .drSulaimanAlHabib, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight + .bold, + fontSize: 24, + fontFamily: 'Poppins'), + ), - Text( - "Doctor App", - style: TextStyle( - fontSize: - SizeConfig.isMobile - ? 16 - : SizeConfig - .realScreenWidth * - 0.030, - fontWeight: FontWeight - .w600, - color: Color(0xFFD02127)), - ), - ]), - ], - )), - SizedBox( - height: 40, - ), - Form( - key: loginFormKey, - child: Column( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - children: [ - Container( - width: SizeConfig - .realScreenWidth * 0.90, - height: SizeConfig - .realScreenHeight * 0.65, - child: - Column( - crossAxisAlignment: CrossAxisAlignment - .start, children: [ + Text( + "Doctor App", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight + .w600, + color: Color(0xFFD02127)), + ), + ]), + ], + )), + SizedBox( + height: 40, + ), + Form( + key: loginFormKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, children: [ - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).enterId, - hasBorder: true, - controller: userIdController, - onChanged: (value){ - if (value != null) - setState(() { - authenticationViewModel.userInfo - .userID = - value - .trim(); - }); - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).enterPassword, - hasBorder: true, - isSecure: true, - controller: passwordController, - onChanged: (value){ - if (value != null) - setState(() { - authenticationViewModel.userInfo - .password = - value - .trim(); - }); - // if(allowCallApi) { - this.getProjects( - authenticationViewModel.userInfo - .userID); - // setState(() { - // allowCallApi = false; - // }); - // } - }, - onClick: (){ + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterId, + hasBorder: true, + controller: userIdController, + onChanged: (value){ + if (value != null) + setState(() { + authenticationViewModel.userInfo + .userID = + value + .trim(); + }); + }, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterPassword, + hasBorder: true, + isSecure: true, + controller: passwordController, + onChanged: (value){ + if (value != null) + setState(() { + authenticationViewModel.userInfo + .password = + value + .trim(); + }); + this.getProjects( + authenticationViewModel.userInfo + .userID); + }, + onClick: (){ - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: (){ - Helpers - .showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, + }, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: (){ + Helpers + .showCupertinoPicker( + context, + projectsList, + 'facilityName', + onSelectProject, + authenticationViewModel); + }, - ), - buildSizedBox() - ]), - ), - ], - ), - ) - ], - ) - ])) - ]), + ), + buildSizedBox(), + ]), + ), + SizedBox( + height: 40, + ), + ], + )), + ), ), bottomSheet: Container( - height: 90, + height: 85, width: double.infinity, child: Center( child: FractionallySizedBox( @@ -260,15 +226,6 @@ class _LoginScreenState extends State { } else { GifLoaderDialogUtils.hideDialog(context); authenticationViewModel.setUnverified(true,isFromLogin: true); - // Navigator.of(context).pushReplacement( - // MaterialPageRoute( - // builder: (BuildContext context) => - // VerificationMethodsScreen( - // password: authenticationViewModel.userInfo.password, - // isFromLogin: true, - // ), - // ), - // ); } } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 8257ebf0..75d6782c 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -65,277 +65,223 @@ class _VerificationMethodsScreenState extends State { body: SingleChildScrollView( child: Center( child: FractionallySizedBox( - child: Container( - 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( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SizedBox( + height: 40, + ), + if(authenticationViewModel.isFromLogin) + InkWell( + onTap: (){ + authenticationViewModel.setUnverified(false,isFromLogin: false); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) + + ), + 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, ), - 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, + 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), ), - 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,), + 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: [ + ), + Row( + 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, + TranslationBase + .of(context) + .verifyWith, + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, ), 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, + authenticationViewModel.getType( + authenticationViewModel.user + .logInTypeID, + context), fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, + color: Color(0xFF2B353E), - ) - ], - ), - ), - SizedBox( - height: 20, - ), - Row( - children: [ + fontWeight: FontWeight.w700, + ), + ], + ) + ], + crossAxisAlignment: CrossAxisAlignment.start,), + Column(children: [ AppText( - "Please Verify", - fontSize: 16, - color: Color(0xFF2B353E), - + 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, + ), + 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: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.Fingerprint, - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - Expanded( + ], + ) + : 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: - AuthMethodTypes.FaceID, + authMethodType: SelectedAuthMethodTypesService + .getMethodsTypeService( + authenticationViewModel.user + .logInTypeID), authenticateUser: (AuthMethodTypes authMethodType, @@ -343,48 +289,95 @@ class _VerificationMethodsScreenState extends State { 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), - )) - ], - ), - ]), - - // ) - ], - ), - ), - ], - ), + ), + 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: 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), + )) + ], + ), + ]), + + // ) + ], + ), + ], ), ), ), diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6d091756..6cdaabd8 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -31,7 +31,7 @@ class MethodTypeCard extends StatelessWidget { ), height: 170, child: Padding( - padding: EdgeInsets.fromLTRB(20, 15, 20, 15), + padding: EdgeInsets.fromLTRB(10, 15, 10, 15), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -50,7 +50,7 @@ class MethodTypeCard extends StatelessWidget { ), AppText( label, - fontSize: 14, + fontSize: 12, color: Color(0xFF2E303A), fontWeight: FontWeight.bold, ) diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 0c374e58..528102b0 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -48,6 +47,8 @@ class SMSOTP { String displayTime = ''; bool isClosed = false; displayDialog(BuildContext context) async { + double dialogWidth = MediaQuery.of(context).size.width * 0.84; + double dialogHeight = MediaQuery.of(context).size.height * 0.50; return showDialog( context: context, barrierColor: Colors.black.withOpacity(0.7), @@ -61,209 +62,213 @@ class SMSOTP { } return Container( color: Colors.white, - height: MediaQuery.of(context).size.height * 0.50, - width: MediaQuery.of(context).size.width * 0.84, + height: dialogHeight, + width: dialogWidth, child: Center( child: SingleChildScrollView( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(13), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - type == AuthMethodTypes.SMS - ? Padding( - child: Icon( - DoctorApp.verify_sms_1, - size: 50, - ), - padding: EdgeInsets.only(bottom: 20), - ) - : Padding( - child: Icon( - DoctorApp.verify_whtsapp, - size: 50, - ), - padding: EdgeInsets.only(bottom: 20), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, right: 10, bottom: 20), - child: IconButton( - icon: Icon(Icons.close), - iconSize: 40, - onPressed: () { - this.isClosed = true; - Navigator.pop(context); - this.onFailure(); - }, - )) - ], - ) - ])), - Padding( - padding: EdgeInsets.only(top: 5, right: 5), - child: AppText( - TranslationBase.of(context).verificationMessage + - ' XXXXXX' + - mobileNo - .toString() - .substring(mobileNo.toString().length - 3), - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, - maxLines: 2, - )), - Form( - key: verifyAccountForm, - child: Padding( - padding: EdgeInsets.only(top: 20), - child: Directionality( - textDirection: TextDirection.ltr, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: SizeConfig.realScreenWidth * 0.16, - margin: EdgeInsets.all(5), - child: TextFormField( - textInputAction: TextInputAction.next, - style: buildTextStyle(), - autofocus: true, - maxLength: 1, - controller: digit1, - textAlign: TextAlign.center, - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - validator: validateCodeDigit, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD2); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); - checkValue(); - } - }, - ), - ), - Container( - width: SizeConfig.realScreenWidth * 0.16, - margin: EdgeInsets.all(5), - child: TextFormField( - focusNode: focusD2, - textInputAction: TextInputAction.next, - maxLength: 1, - controller: digit2, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), - onSaved: (val) {}, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD3); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit), - ), - Container( - margin: EdgeInsets.all(5), - width: SizeConfig.realScreenWidth * 0.16, - child: TextFormField( - focusNode: focusD3, - textInputAction: TextInputAction.next, - maxLength: 1, - controller: digit3, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), - onSaved: (val) {}, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - Container( - margin: EdgeInsets.all(5), - width: SizeConfig.realScreenWidth * 0.16, - child: TextFormField( - focusNode: focusD4, - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - controller: digit4, - keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - ], - )), - ), - ), - Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).validationMessage + - ' ', - fontWeight: FontWeight.w600, - fontSize: 14, + children: [ + Padding( + padding: EdgeInsets.all(13), + child: Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + children: [ + Padding( + child: Icon( + type == AuthMethodTypes.SMS + ? DoctorApp.verify_sms_1 + : DoctorApp.verify_whtsapp, + size: dialogWidth * 0.13, + ), + padding: EdgeInsets.only(bottom: 20), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 20), + child: IconButton( + icon: Icon(Icons.close), + iconSize: dialogWidth * 0.13, + onPressed: () { + this.isClosed = true; + Navigator.pop(context); + this.onFailure(); + }, + )) + ], + ) + ])), + Padding( + padding: EdgeInsets.only(top: 5, right: 5), + child: AppText( + TranslationBase.of(context).verificationMessage + + ' XXXXXX' + + mobileNo + .toString() + .substring(mobileNo.toString().length - 3), + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: 14, + maxLines: 2, + )), + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only(top: 20), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: (dialogWidth / 4) - 20, + height: 100, + margin: EdgeInsets.all(5), + child: TextFormField( + textInputAction: TextInputAction + .next, + style: buildTextStyle(), + autofocus: true, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + decoration: buildInputDecoration( + context), + onSaved: (val) {}, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = + val.trim(); + checkValue(); + } + }, + ), + ), + Container( + width: dialogWidth / 4 - 30, + margin: EdgeInsets.all(5), + child: TextFormField( + focusNode: focusD2, + textInputAction: TextInputAction + .next, + maxLength: 1, + controller: digit2, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType + .number, + decoration: buildInputDecoration( + context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit), + ), + Container( + margin: EdgeInsets.all(5), + width: dialogWidth / 4 - 30, + child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction + .next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + Container( + margin: EdgeInsets.all(5), + width: dialogWidth / 4 - 30, + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue['digit4'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + ], + )), + ), ), - AppText( - displayTime, - color: Colors.red, - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, + Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).validationMessage + + ' ', + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + displayTime, + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: 14, + ) + ]), ) - ]), - ) - ], - ))), + ], + ))), ); }), ); From 2b8caab71db452428061039ef20834c58d749674 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 24 May 2021 12:35:54 +0300 Subject: [PATCH 02/42] fix sms pop up scrolling --- lib/config/size_config.dart | 29 +++ lib/widgets/auth/sms-popup.dart | 354 ++++++++++++++++---------------- 2 files changed, 211 insertions(+), 172 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6b996b3f..2763091b 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -17,6 +17,7 @@ class SizeConfig { static bool isPortrait = true; static bool isMobilePortrait = false; static bool isMobile = false; + static bool isHeightShort = false; void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; @@ -26,6 +27,9 @@ class SizeConfig { if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } + if (constraints.maxHeight < 800) { + isHeightShort = true; + } if (orientation == Orientation.portrait) { isPortrait = true; if (realScreenWidth < 450) { @@ -60,4 +64,29 @@ class SizeConfig { print('isPortrait $isPortrait'); print('isMobilePortrait $isMobilePortrait'); } + + static getTextMultiplierBasedOnWidth({double width}){ + // TODO handel LandScape case + if(width != null) { + return width / 100; + } + return widthMultiplier; + } + + + static getWidthMultiplier({double width}){ + // TODO handel LandScape case + if(width != null) { + return width / 100; + } + return widthMultiplier; + } + + static getHeightMultiplier({double height}){ + // TODO handel LandScape case + if(height != null) { + return height / 100; + } + return heightMultiplier; + } } diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 528102b0..b998614b 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -5,7 +5,9 @@ import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class SMSOTP { @@ -47,208 +49,208 @@ class SMSOTP { String displayTime = ''; bool isClosed = false; displayDialog(BuildContext context) async { - double dialogWidth = MediaQuery.of(context).size.width * 0.84; - double dialogHeight = MediaQuery.of(context).size.height * 0.50; + double dialogWidth = MediaQuery.of(context).size.width * 0.90; + double dialogHeight = SizeConfig.isHeightShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40; return showDialog( context: context, - barrierColor: Colors.black.withOpacity(0.7), - builder: (context) { - projectProvider = Provider.of(context); - return AlertDialog( - contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 0.0, 24.0), - content: StatefulBuilder(builder: (context, setState) { - if (displayTime == '') { - startTimer(setState); - } - return Container( - color: Colors.white, - height: dialogHeight, - width: dialogWidth, - child: Center( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(13), - child: Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - children: [ - Padding( - child: Icon( - type == AuthMethodTypes.SMS - ? DoctorApp.verify_sms_1 - : DoctorApp.verify_whtsapp, - size: dialogWidth * 0.13, - ), - padding: EdgeInsets.only(bottom: 20), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, right: 10, bottom: 20), - child: IconButton( - icon: Icon(Icons.close), - iconSize: dialogWidth * 0.13, - onPressed: () { - this.isClosed = true; - Navigator.pop(context); - this.onFailure(); - }, - )) - ], - ) - ])), - Padding( - padding: EdgeInsets.only(top: 5, right: 5), - child: AppText( - TranslationBase.of(context).verificationMessage + - ' XXXXXX' + - mobileNo - .toString() - .substring(mobileNo.toString().length - 3), - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, - maxLines: 2, - )), - Form( - key: verifyAccountForm, - child: Padding( - padding: EdgeInsets.only(top: 20), - child: Directionality( - textDirection: TextDirection.ltr, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, + builder: (ctx) => Center( + child: Container( + height: dialogHeight, + width: dialogWidth, + child: AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + child: Container( + color: Colors.white, + child: StatefulBuilder(builder: (context, setState) { + if (displayTime == '') { + startTimer(setState); + } + + return Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2,), + + Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + children: [ + Icon( + type == AuthMethodTypes.SMS + ? DoctorApp.verify_sms_1 + : DoctorApp.verify_whtsapp, + size: dialogWidth * 0.13, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - width: (dialogWidth / 4) - 20, - height: 100, - margin: EdgeInsets.all(5), - child: TextFormField( - textInputAction: TextInputAction - .next, - style: buildTextStyle(), - autofocus: true, - maxLength: 1, - controller: digit1, - textAlign: TextAlign.center, - keyboardType: TextInputType.number, - decoration: buildInputDecoration( - context), - onSaved: (val) {}, - validator: validateCodeDigit, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD2); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); - checkValue(); - } - }, - ), - ), - Container( - width: dialogWidth / 4 - 30, - margin: EdgeInsets.all(5), - child: TextFormField( - focusNode: focusD2, + IconButton( + icon: Icon(Icons.close), + iconSize: dialogWidth * 0.13, + onPressed: () { + this.isClosed = true; + Navigator.pop(context); + this.onFailure(); + }, + ) + ], + ) + ]), + SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 10,), + Padding( + padding: EdgeInsets.only(top: 5, right: 5), + child: AppText( + TranslationBase.of(context).verificationMessage + + ' XXXXXX' + + mobileNo + .toString() + .substring(mobileNo.toString().length - 3), + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, //14, + maxLines: 2, + )), + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: (dialogWidth / 4) - 20, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + child: TextFormField( textInputAction: TextInputAction .next, + style: buildTextStyle(), + autofocus: true, maxLength: 1, - controller: digit2, + controller: digit1, textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType - .number, + keyboardType: TextInputType.number, decoration: buildInputDecoration( context), onSaved: (val) {}, + validator: validateCodeDigit, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD3); + .requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit), - ), - Container( - margin: EdgeInsets.all(5), - width: dialogWidth / 4 - 30, + ), + ), + Container( + width: dialogWidth / 4 - 20, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), child: TextFormField( - focusNode: focusD3, + focusNode: focusD2, textInputAction: TextInputAction .next, maxLength: 1, - controller: digit3, + controller: digit2, textAlign: TextAlign.center, style: buildTextStyle(), keyboardType: TextInputType .number, - decoration: - buildInputDecoration(context), + decoration: buildInputDecoration( + context), onSaved: (val) {}, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD4); + .requestFocus(focusD3); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit)), - Container( - margin: EdgeInsets.all(5), - width: dialogWidth / 4 - 30, - child: TextFormField( - focusNode: focusD4, - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - controller: digit4, - keyboardType: TextInputType - .number, - decoration: - buildInputDecoration(context), - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - ], - )), + validator: validateCodeDigit), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + width: dialogWidth / 4 - 20, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction + .next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + Container( + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + width: dialogWidth / 4 - 20, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue['digit4'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + ], + )), + ), ), - ), - Padding( - padding: const EdgeInsets.all(12.0), - child: Column( + Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -256,7 +258,7 @@ class SMSOTP { TranslationBase.of(context).validationMessage + ' ', fontWeight: FontWeight.w600, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, ), AppText( displayTime, @@ -265,19 +267,27 @@ class SMSOTP { fontWeight: FontWeight.bold, fontSize: 14, ) - ]), - ) - ], - ))), - ); - }), - ); - }); + ]) + ], + ), + ), + ); + + }) + + + ), + ), + ), + ), + ), + + ); } TextStyle buildTextStyle() { return TextStyle( - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2.5, ); } From 362d9425cdcb5377ef875d5e82a285ed9d0a6195 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 24 May 2021 16:10:31 +0300 Subject: [PATCH 03/42] fix scrolling in verification --- .../auth/verification_methods_screen.dart | 70 ++++++++++--------- lib/widgets/auth/method_type_card.dart | 14 ++-- .../auth/verification_methods_list.dart | 2 +- .../shared/buttons/app_buttons_widget.dart | 5 +- 4 files changed, 48 insertions(+), 43 deletions(-) diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 75d6782c..b6eaa8db 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -71,7 +71,7 @@ class _VerificationMethodsScreenState extends State { // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - height: 40, + height: SizeConfig.heightMultiplier * 3, ), if(authenticationViewModel.isFromLogin) InkWell( @@ -85,7 +85,7 @@ class _VerificationMethodsScreenState extends State { Column( children: [ SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*4, ), authenticationViewModel.user != null && isMoreOption == false ? Column( @@ -96,27 +96,27 @@ class _VerificationMethodsScreenState extends State { AppText( TranslationBase.of(context).welcomeBack, - fontSize:12, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4, fontWeight: FontWeight.w700, color: Color(0xFF2B353E), ), AppText( Helpers.capitalize(authenticationViewModel.user.doctorName), - fontSize: 24, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, ), SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*4, ), AppText( - TranslationBase.of(context).accountInfo , - fontSize: 16, + TranslationBase.of(context).accountInfo , + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*5, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, ), SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*4 ), Container( padding: EdgeInsets.all(15), @@ -142,7 +142,7 @@ class _VerificationMethodsScreenState extends State { TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', - fontSize: 16, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700,), @@ -153,7 +153,7 @@ class _VerificationMethodsScreenState extends State { TranslationBase .of(context) .verifyWith, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -162,7 +162,7 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel.user .logInTypeID, context), - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, @@ -187,7 +187,7 @@ class _VerificationMethodsScreenState extends State { : '--', textAlign: TextAlign.right, - fontSize: 13, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, ), @@ -206,7 +206,7 @@ class _VerificationMethodsScreenState extends State { : '--', textAlign: TextAlign.right, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, fontWeight: FontWeight.w600, color: Color(0xFF575757), ) @@ -218,19 +218,25 @@ class _VerificationMethodsScreenState extends State { ), ), SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*3, ), + Row( children: [ + + //todo add translation AppText( "Please Verify", - fontSize: 16, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, ), ], - ) + ), + SizedBox( + height: SizeConfig.heightMultiplier*2, + ), ], ) : Column( @@ -243,8 +249,8 @@ class _VerificationMethodsScreenState extends State { margin: EdgeInsets.only(bottom: 20, top: 30), child: AppText( TranslationBase.of(context) - .verifyLoginWith, - fontSize: 18, + .verifyLoginWith , + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 4 , color: Color(0xFF2E303A), fontWeight: FontWeight.bold, textAlign: TextAlign.left, @@ -254,7 +260,7 @@ class _VerificationMethodsScreenState extends State { TranslationBase.of(context) .verifyFingerprint2, fontSize: - SizeConfig.textMultiplier * 2.5, + SizeConfig.getTextMultiplierBasedOnWidth()* 4, textAlign: TextAlign.start, ), ]), @@ -383,34 +389,32 @@ class _VerificationMethodsScreenState extends State { ), ), bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( - height: 90, + // color: Colors.green, + height: SizeConfig.heightMultiplier * 10 , width: double.infinity, child: Center( child: FractionallySizedBox( widthFactor: 0.9, child: Column( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.center, children: [ - SecondaryButton( - label: TranslationBase + AppButton( + title: TranslationBase .of(context) .useAnotherAccount, color: Color(0xFFD02127), - //fontWeight: FontWeight.w700, - onTap: () { + + fontWeight: FontWeight.w700, + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 8 : 6), + hPadding: 1, + + onPressed: () { authenticationViewModel.deleteUser(); authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - // Navigator.pushAndRemoveUntil( - // AppGlobal.CONTEX, - // FadePage( - // page: RootPage(), - // ), - // (r) => false); - // Navigator.of(context).pushNamed(LOGIN); }, ), - SizedBox(height: 25,) + // SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 1 : 3),) ], ), ), diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6cdaabd8..1945546a 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.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:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -29,19 +30,18 @@ class MethodTypeCard extends StatelessWidget { color: HexColor('#707070'), width: 0.1), ), - height: 170, - child: Padding( - padding: EdgeInsets.fromLTRB(10, 15, 10, 15), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 22 : 15), + child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( assetPath, - height: 60, - width: 60, + width: SizeConfig.widthMultiplier* 12, ), ], ), @@ -50,7 +50,7 @@ class MethodTypeCard extends StatelessWidget { ), AppText( label, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 2.5, color: Color(0xFF2E303A), fontWeight: FontWeight.bold, ) diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 27dbe8bf..264fefb3 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -89,7 +89,7 @@ class _VerificationMethodsListState extends State { assetPath: 'assets/images/login/more_icon.png', onTap: widget.onShowMore, label: TranslationBase.of(context).moreVerification, - height: 0, + height: 40, ); } } diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index ed3e6e98..d2a5b2a0 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, @@ -39,7 +40,7 @@ class AppButton extends StatefulWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, + this.borderColor, this.height, }); _AppButtonState createState() => _AppButtonState(); @@ -49,7 +50,7 @@ class _AppButtonState extends State { @override 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( From 8f6de2e02b1838b574dbf8185f295415b15f43f4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 24 May 2021 17:35:29 +0300 Subject: [PATCH 04/42] fix login --- lib/screens/auth/login_screen.dart | 216 +++++++++++++---------------- 1 file changed, 98 insertions(+), 118 deletions(-) diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 9eccd1c1..a982ae79 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -13,7 +13,6 @@ import 'package:provider/provider.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; - class LoginScreen extends StatefulWidget { @override _LoginScreenState createState() => _LoginScreenState(); @@ -35,6 +34,7 @@ class _LoginScreenState extends State { @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); + double textFieldHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightShort ?10:6); return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), @@ -49,124 +49,100 @@ class _LoginScreenState extends State { //TODO Use App Text rather than text Container( child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - SizedBox( - height: 30, - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, children: [ + crossAxisAlignment: CrossAxisAlignment.start, + children: [ SizedBox( height: 10, ), Text( - TranslationBase - .of(context) - .welcomeTo, + TranslationBase.of(context).welcomeTo, style: TextStyle( - fontSize: 12, - fontWeight: FontWeight - .w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + fontWeight: FontWeight.w600, fontFamily: 'Poppins'), ), Text( - TranslationBase - .of(context) - .drSulaimanAlHabib, + TranslationBase.of(context).drSulaimanAlHabib, style: TextStyle( color: Color(0xFF2B353E), - fontWeight: FontWeight - .bold, - fontSize: 24, + fontWeight: FontWeight.bold, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 6, fontFamily: 'Poppins'), ), - Text( "Doctor App", style: TextStyle( - fontSize: 12, - fontWeight: FontWeight - .w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + fontWeight: FontWeight.w600, color: Color(0xFFD02127)), ), - ]), - ], - )), + ])), SizedBox( height: 40, ), Form( key: loginFormKey, child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, children: [ - - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).enterId, - hasBorder: true, - controller: userIdController, - onChanged: (value){ - if (value != null) - setState(() { - authenticationViewModel.userInfo - .userID = - value - .trim(); - }); - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).enterPassword, - hasBorder: true, - isSecure: true, - controller: passwordController, - onChanged: (value){ - if (value != null) - setState(() { - authenticationViewModel.userInfo - .password = - value - .trim(); - }); - this.getProjects( - authenticationViewModel.userInfo - .userID); - }, - onClick: (){ - - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context).selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: (){ - Helpers - .showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, - - - ), - buildSizedBox(), - ]), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildSizedBox(), + AppTextFieldCustom( + height: textFieldHeight, + hintText: TranslationBase.of(context).enterId, + hasBorder: true, + controller: userIdController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.userID = + value.trim(); + }); + }, + ), + buildSizedBox(), + AppTextFieldCustom( + height: textFieldHeight, + hintText: TranslationBase.of(context).enterPassword, + hasBorder: true, + isSecure: true, + controller: passwordController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.password = + value.trim(); + }); + this.getProjects( + authenticationViewModel.userInfo.userID); + }, + onClick: () {}, + ), + buildSizedBox(), + AppTextFieldCustom( + height: textFieldHeight, + hintText: + TranslationBase.of(context).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: projectsList.isEmpty== null ? null:() { + Helpers.showCupertinoPicker( + context, + projectsList, + 'facilityName', + onSelectProject, + authenticationViewModel); + }, + ), + buildSizedBox(), + ]), ), SizedBox( height: 40, @@ -176,46 +152,47 @@ class _LoginScreenState extends State { ), ), bottomSheet: Container( - - height: 85, + // color: Colors.green, + height: SizeConfig.heightMultiplier * 10, width: double.infinity, child: Center( child: FractionallySizedBox( widthFactor: 0.9, child: Column( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.center, children: [ AppButton( - title: TranslationBase - .of(context) - .login, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 8 : 6), + hPadding: 1, + title: TranslationBase.of(context).login, color: Color(0xFFD02127), fontWeight: FontWeight.w700, - disabled: authenticationViewModel.userInfo - .userID == null || - authenticationViewModel.userInfo - .password == - null, + disabled: authenticationViewModel.userInfo.userID == null || + authenticationViewModel.userInfo.password == null, onPressed: () { login(context); }, ), - SizedBox(height: 25,) + // SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 1 : 3),) ], ), ), - ),), + ), + ), ); } SizedBox buildSizedBox() { return SizedBox( - height: 20, + height: SizeConfig.heightMultiplier * 2, ); } - login(context,) async { + login( + context, + ) async { if (loginFormKey.currentState.validate()) { loginFormKey.currentState.save(); GifLoaderDialogUtils.showMyDialog(context); @@ -225,29 +202,32 @@ class _LoginScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - authenticationViewModel.setUnverified(true,isFromLogin: true); + authenticationViewModel.setUnverified(true, isFromLogin: true); } } } onSelectProject(index) { setState(() { - authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; + authenticationViewModel.userInfo.projectID = + projectsList[index].facilityId; projectIdController.text = projectsList[index].facilityName; }); primaryFocus.unfocus(); } - String memberID =""; - getProjects(memberID)async { + + String memberID = ""; + getProjects(memberID) async { if (memberID != null && memberID != '') { - if (this.memberID !=memberID) { + if (this.memberID != memberID) { this.memberID = memberID; await authenticationViewModel.getHospitalsList(memberID); - if(authenticationViewModel.state == ViewState.Idle) { + if (authenticationViewModel.state == ViewState.Idle) { projectsList = authenticationViewModel.hospitals; setState(() { - authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; + authenticationViewModel.userInfo.projectID = + projectsList[0].facilityId; projectIdController.text = projectsList[0].facilityName; }); } From 2fa8fa61772f797046246008f51ddedd2f6d6951 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 30 May 2021 10:57:13 +0300 Subject: [PATCH 05/42] fix back icon place --- .../auth/verification_methods_screen.dart | 5 ++--- lib/widgets/auth/sms-popup.dart | 21 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index b6eaa8db..1c9d7c13 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -68,10 +68,9 @@ class _VerificationMethodsScreenState extends State { widthFactor: 0.9, child: Column( crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - height: SizeConfig.heightMultiplier * 3, + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?6:4), ), if(authenticationViewModel.isFromLogin) InkWell( @@ -85,7 +84,7 @@ class _VerificationMethodsScreenState extends State { Column( children: [ SizedBox( - height: SizeConfig.heightMultiplier*4, + height: SizeConfig.heightMultiplier*(SizeConfig.isHeightShort?3:4), ), authenticationViewModel.user != null && isMoreOption == false ? Column( diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index b998614b..d2a65655 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -57,15 +57,14 @@ class SMSOTP { child: Container( height: dialogHeight, width: dialogWidth, - child: AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( + child: Material( + child: SingleChildScrollView( child: Container( - color: Colors.white, - child: StatefulBuilder(builder: (context, setState) { - if (displayTime == '') { - startTimer(setState); - } + color: Colors.white, + child: StatefulBuilder(builder: (context, setState) { + if (displayTime == '') { + startTimer(setState); + } return Center( child: FractionallySizedBox( @@ -273,13 +272,13 @@ class SMSOTP { ), ); - }) + }) - ), - ), + ), ), ), + ), ), ); From 2bff3a594c268d281a8c38f9e5c8d29e422f8b31 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 30 May 2021 15:25:56 +0300 Subject: [PATCH 06/42] first step from fix home page design --- ios/Podfile.lock | 2 +- lib/config/config.dart | 4 +-- .../home/dashboard_slider-item-widget.dart | 6 ++-- lib/screens/home/dashboard_swipe_widget.dart | 4 +-- lib/screens/home/home_page_card.dart | 6 ++-- lib/screens/home/home_patient_card.dart | 10 +++---- lib/screens/home/home_screen.dart | 29 +++++++++---------- lib/widgets/dashboard/activity_button.dart | 9 +++--- lib/widgets/dashboard/out_patient_stack.dart | 10 +++---- lib/widgets/dashboard/row_count.dart | 5 ++-- .../profile/profile-welcome-widget.dart | 5 ++-- pubspec.lock | 6 ++-- 12 files changed, 47 insertions(+), 49 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 59cdf14c..1cf7499c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -328,4 +328,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index c8af8ad9..0283577e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..62176ae8 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -18,18 +18,18 @@ class DashboardSliderItemWidget extends StatelessWidget { children: [ AppText( item.kPIName, - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontWeight: FontWeight.bold, ), ], ), new Container( - height: 110, + height: SizeConfig.heightMultiplier* 20, child: ListView( scrollDirection: Axis.horizontal, children: List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[index]); + return GetActivityCard(item.summaryoptions[index]); }))) ], ); diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index de5cc05f..05065539 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -143,14 +143,14 @@ class _DashboardSwipeWidgetState extends State { AppText( TranslationBase.of(context) .patients, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontWeight: FontWeight.bold, fontHeight: 0.5, ), AppText( TranslationBase.of(context) .referral, - fontSize: 22, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, fontWeight: FontWeight.bold, ), ], diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..6da90d5c 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -24,10 +25,7 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: 120, - height: MediaQuery.of(context).orientation == Orientation.portrait - ? 100 - : 200, + width: SizeConfig.widthMultiplier * 22, margin: this.margin, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index bdaac7a7..a0a24b89 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -35,13 +35,13 @@ class HomePatientCard extends StatelessWidget { child: Stack( children: [ Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, + bottom: 0.01, + right: 0.2, + width: 10.0, height: 25.0, child: Icon( cardIcon, - size: 60, + size: SizeConfig.widthMultiplier* 15, color: backgroundIconColor, ), ), @@ -52,7 +52,7 @@ class HomePatientCard extends StatelessWidget { children: [ Icon( cardIcon, - size: 30, + size: SizeConfig.widthMultiplier* 8, color: textColor, ), SizedBox( diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c305b752..9ee7a6f5 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.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/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; @@ -48,7 +49,6 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; ProjectViewModel projectsProvider; - var _isInit = true; DoctorProfileModel profile; bool isExpanded = false; bool isInpatient = false; @@ -87,7 +87,7 @@ class _HomeScreenState extends State { child: Stack(children: [ IconButton( icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), + width:SizeConfig.widthMultiplier* 7,), iconSize: 18, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -112,7 +112,7 @@ class _HomeScreenState extends State { ? projectsProvider .doctorClinicsList[0].clinicID : clinicId, - iconSize: 25, + iconSize: SizeConfig.widthMultiplier* 7, elevation: 16, selectedItemBuilder: (BuildContext context) { @@ -122,7 +122,7 @@ class _HomeScreenState extends State { return Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: - MainAxisAlignment.end, + MainAxisAlignment.start, children: [ Column( mainAxisAlignment: @@ -159,8 +159,8 @@ class _HomeScreenState extends State { fontSize: projectsProvider .isArabic - ? 10 - : 11, + ? SizeConfig.widthMultiplier* 3.5 + : SizeConfig.widthMultiplier* 4, textAlign: TextAlign .center, @@ -169,8 +169,9 @@ class _HomeScreenState extends State { ], ), AppText(item.clinicName, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.width * .6) * 5, color: Colors.black, + textOverflow:TextOverflow.ellipsis , fontWeight: FontWeight.bold, textAlign: TextAlign.end), @@ -264,8 +265,7 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 10, - ), + height: SizeConfig.heightMultiplier *1, ), Container( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -273,30 +273,27 @@ class _HomeScreenState extends State { children: [ AppText( TranslationBase.of(context).patients, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 3, fontWeight: FontWeight.bold, fontHeight: .5, ), AppText( TranslationBase.of(context).services, - fontSize: 22, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 6, fontWeight: FontWeight.bold, ), ], )), SizedBox( - height: 10, + height: SizeConfig.heightMultiplier *1, ), Container( - height: 120, + height: SizeConfig.heightMultiplier* 18, child: ListView( scrollDirection: Axis.horizontal, children: [ ...homePatientsCardsWidget(model), ])), - SizedBox( - height: 20, - ), ], ), ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index ff9db962..ed38de96 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -1,10 +1,11 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class GetActivityButton extends StatelessWidget { +class GetActivityCard extends StatelessWidget { final value; - GetActivityButton(this.value); + GetActivityCard(this.value); @override Widget build(BuildContext context) { @@ -24,14 +25,14 @@ class GetActivityButton extends StatelessWidget { children: [ AppText( value.value.toString(), - fontSize: 27, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), ), AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fe05d69d..41fe28e2 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -20,11 +21,10 @@ class GetOutPatientStack extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( - height: 30, child: AppText( value.kPIName, medium: true, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) @@ -63,7 +63,7 @@ class GetOutPatientStack extends StatelessWidget { ), ), Container( - height: (MediaQuery.of(context).size.height * 0.24 ), + height: MediaQuery.of(context).size.height * 0.20, margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( @@ -75,14 +75,14 @@ class GetOutPatientStack extends StatelessWidget { children: [ AppText( value.kPIParameter, - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, ), AppText( ' (' + value.value.toString() + ') ', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a22932f4..a23fb8b9 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.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:flutter/material.dart'; @@ -24,7 +25,7 @@ class RowCounts extends StatelessWidget { name, color: Colors.black, textAlign: TextAlign.start, // from TextAlign.center - fontSize: 11, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textOverflow: TextOverflow.ellipsis, ), ), @@ -32,7 +33,7 @@ class RowCounts extends StatelessWidget { ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2, fontWeight: FontWeight.bold, ) ], diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 53228bc2..a7621115 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -35,8 +36,8 @@ class ProfileWelcomeWidget extends StatelessWidget { child: Image.network( authenticationViewModel.doctorProfile.doctorImageURL, fit: BoxFit.fill, - width: 75, - height: 75, + width: SizeConfig.widthMultiplier* 11, + height: SizeConfig.widthMultiplier* 11, ), ), backgroundColor: Colors.transparent, diff --git a/pubspec.lock b/pubspec.lock index 613c2753..4b6a9b7a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -629,7 +629,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -921,7 +921,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1119,5 +1119,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0" From dc22e3f46e585816b36e4c403a9a7aaef33827d2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 30 May 2021 15:48:24 +0300 Subject: [PATCH 07/42] fix bottom sheet --- lib/screens/home/home_screen.dart | 38 +++++++++---------- .../shared/bottom_navigation_item.dart | 15 ++++++-- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 9ee7a6f5..971f707d 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; @@ -6,10 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; @@ -22,7 +18,6 @@ import 'package:doctor_app_flutter/screens/patients/patient_search/patient_searc import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -83,16 +78,18 @@ class _HomeScreenState extends State { StickyHeader( header: Container( color: Colors.grey[100], - padding: EdgeInsets.only(top: 10), child: Stack(children: [ IconButton( - icon: Image.asset('assets/images/menu.png', - width:SizeConfig.widthMultiplier* 7,), - iconSize: 18, + icon: Image.asset( + 'assets/images/menu.png', + width: SizeConfig.widthMultiplier * 7, + ), + iconSize: SizeConfig.heightMultiplier * 2, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), ), - Column(children: [ + Column( + children: [ ProfileWelcomeWidget( Row( mainAxisAlignment: MainAxisAlignment.start, @@ -204,16 +201,19 @@ class _HomeScreenState extends State { value: item.clinicID, ); }).toList(), - )), - ], - ) - : AppText( - TranslationBase.of(context).noClinic), + )), + ], + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + ), + ], ), - ], - ), - isClinic: true, - height: 50, + isClinic: true, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 10 : 8), ), ]) ])), diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index e69ff690..c676d344 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -21,7 +22,8 @@ class BottomNavigationItem extends StatelessWidget { Widget build(BuildContext context) { return Expanded( child: SizedBox( - height: 70.0, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 10 : 8), child: Material( type: MaterialType.transparency, child: InkWell( @@ -32,19 +34,24 @@ class BottomNavigationItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox(height: 15,), + SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 10 : 8) ) * 10,), Container( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? Color(0xFF333C45) : Theme.of(context).dividerColor, - size: 22.0), + size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 10 : 8) ) * 40,), ), - SizedBox(height: 5,), + SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 10 : 8) ) * 0.5,), Expanded( child: Text( name, + style: TextStyle( + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, color: currentIndex == index ? Theme.of(context).primaryColor : Theme.of(context).dividerColor, From acffc72f56465a7cf297cca04df2190348bd65a2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 30 May 2021 16:58:38 +0300 Subject: [PATCH 08/42] prevent scrolling on home page --- lib/screens/home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/dashboard_swipe_widget.dart | 3 ++- lib/screens/home/home_page_card.dart | 4 ++-- lib/screens/home/home_screen.dart | 12 +++++++----- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 62176ae8..1bc65f2e 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -24,7 +24,7 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: SizeConfig.heightMultiplier* 20, + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:15), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 05065539..281b8c7c 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -29,7 +29,8 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { return Container( - height: MediaQuery.of(context).size.height * 0.35, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 40 : 30), // height: 230, child: Swiper( onIndexChanged: (index) { diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 6da90d5c..6ad22c3a 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -25,9 +25,9 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: SizeConfig.widthMultiplier * 22, + width: SizeConfig.widthMultiplier * 30, margin: this.margin, - decoration: BoxDecoration( + decoration: BoxDecoration( color: !hasBorder ? color != null ? color diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 971f707d..94cad8f2 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -142,8 +142,8 @@ class _HomeScreenState extends State { ), constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, + minWidth: SizeConfig.widthMultiplier* 6, + minHeight: SizeConfig.widthMultiplier* 6, ), child: Center( child: AppText( @@ -265,7 +265,7 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier *1, ), + height: SizeConfig.heightMultiplier *1,), Container( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -288,12 +288,14 @@ class _HomeScreenState extends State { height: SizeConfig.heightMultiplier *1, ), Container( - height: SizeConfig.heightMultiplier* 18, + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:15), child: ListView( scrollDirection: Axis.horizontal, children: [ ...homePatientsCardsWidget(model), - ])), + ],),), + SizedBox( + height: SizeConfig.heightMultiplier *1,), ], ), ), From 97f7426aeeee806c847ab2ccf6cc2cf1d202fe44 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 31 May 2021 10:52:54 +0300 Subject: [PATCH 09/42] fix drawer design --- lib/widgets/shared/app_drawer_widget.dart | 91 +++++++++++++++------- lib/widgets/shared/drawer_item_widget.dart | 5 +- 2 files changed, 65 insertions(+), 31 deletions(-) diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 8f8c0108..820c63cb 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -31,6 +31,7 @@ class _AppDrawerState extends State { Widget build(BuildContext context) { AuthenticationViewModel authenticationViewModel = Provider.of(context); projectsProvider = Provider.of(context); + double drawerWidth = SizeConfig.realScreenWidth * 0.60; return RoundedContainer( child: Container( color: Colors.white, @@ -41,7 +42,6 @@ class _AppDrawerState extends State { child: ListView(padding: EdgeInsets.zero, children: [ Container( margin: EdgeInsets.symmetric(horizontal: 15), - // height: SizeConfig.heightMultiplier * 50, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -50,8 +50,11 @@ class _AppDrawerState extends State { Container( child: Image.asset( 'assets/images/dr_app_logo.png', + width: SizeConfig.getWidthMultiplier( + width: drawerWidth) * 30, + ), - margin: EdgeInsets.only(top: 10, bottom: 10), + margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 1, bottom: SizeConfig.heightMultiplier * 0.5), ), Container( child: InkWell( @@ -60,16 +63,16 @@ class _AppDrawerState extends State { }, child: Icon( DoctorApp.close_1, - size: 20, + size: SizeConfig.heightMultiplier * 3, ), ), - margin: EdgeInsets.only(top: 20, bottom: 10), + margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2, bottom: SizeConfig.heightMultiplier * 0.5), ) ], crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, ), - SizedBox(height: 5), + SizedBox(height: SizeConfig.heightMultiplier * 0.5,), if (authenticationViewModel.doctorProfile != null) InkWell( onTap: () { @@ -85,31 +88,42 @@ class _AppDrawerState extends State { Padding( padding: EdgeInsets.only(top: 10), child: AppText( - TranslationBase.of(context).dr + - authenticationViewModel.doctorProfile?.doctorName, + TranslationBase + .of(context) + .dr + + authenticationViewModel.doctorProfile + ?.doctorName, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontSize: 17, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: drawerWidth) * 8, ), ), Padding( padding: EdgeInsets.only(top: 0), child: AppText( - authenticationViewModel.doctorProfile?.clinicDescription, + authenticationViewModel.doctorProfile + ?.clinicDescription, fontWeight: FontWeight.w600, color: Color(0xFF2E303A), - fontSize: 15, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: drawerWidth) * 6, fontFamily: 'Poppins', )) ], ), ), - SizedBox(height: 40), + SizedBox(height: SizeConfig.heightMultiplier * 4,), InkWell( child: DrawerItem( - TranslationBase.of(context).applyOrRescheduleLeave, + TranslationBase + .of(context) + .applyOrRescheduleLeave, icon: DoctorApp.reschedule__1, + drawerWidth: drawerWidth, // subTitle: , ), onTap: () { @@ -122,19 +136,26 @@ class _AppDrawerState extends State { )); }, ), - SizedBox(height: 15), + SizedBox(height: SizeConfig.heightMultiplier *2), InkWell( child: DrawerItem( - TranslationBase.of(context).myQRCode, + TranslationBase + .of(context) + .myQRCode, icon: DoctorApp.qr_code_3, + drawerWidth: drawerWidth, + // subTitle: , ), ), - SizedBox(height: 15), + SizedBox(height: SizeConfig.heightMultiplier *1.5), InkWell( child: Container( - height: 80, - child: Image.asset('assets/images/qr_code.png'), + // height: 80, + child: Image.asset('assets/images/qr_code.png', + width: SizeConfig.getWidthMultiplier( + width: drawerWidth) * 30, + ), ), onTap: () {}, ), @@ -142,7 +163,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: MediaQuery.of(context).size.height * 0.09, + height: SizeConfig.heightMultiplier * 5, ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -150,13 +171,19 @@ class _AppDrawerState extends State { children: [ InkWell( child: DrawerItem( + projectsProvider.isArabic - ? TranslationBase.of(context).lanEnglish - : TranslationBase.of(context).lanArabic, + ? TranslationBase + .of(context) + .lanEnglish + : TranslationBase + .of(context) + .lanArabic, // icon: DoctorApp.qr_code, assetLink: projectsProvider.isArabic ? 'assets/images/usa-flag.png' : 'assets/images/saudi-arabia-flag.png', + drawerWidth: drawerWidth, ), onTap: () { if (projectsProvider.isArabic) @@ -165,11 +192,15 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), - SizedBox(height: 10), + SizedBox(height: SizeConfig.heightMultiplier *0.5 ), InkWell( child: DrawerItem( - TranslationBase.of(context).logout, + TranslationBase + .of(context) + .logout, icon: DoctorApp.logout_1, + drawerWidth: drawerWidth, + ), onTap: () async { Navigator.pop(context); @@ -187,7 +218,6 @@ class _AppDrawerState extends State { flex: 1, child: Column(children: [ Container( - // This align moves the children to the bottom child: Align( alignment: FractionalOffset.bottomCenter, child: Container( @@ -202,7 +232,9 @@ class _AppDrawerState extends State { style: TextStyle( color: Color(0xFF989898), fontWeight: FontWeight.bold, - fontSize: 14, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: drawerWidth) * 6, fontFamily: 'Poppins', ), children: [ @@ -210,24 +242,25 @@ class _AppDrawerState extends State { text: ' Cloud Solutions', style: TextStyle( color: Color(0xFF2E303A), - fontSize: 15, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: drawerWidth) * 7, fontFamily: 'Poppins', ), ) ]), ), ), - // Text("Powered by"), Image.asset( 'assets/images/cs_logo_container.png', width: SizeConfig.imageSizeMultiplier * 20, ) ], - )))) + )))) ])) - ])), + ])), ), - width: SizeConfig.realScreenWidth * 0.60, + width: drawerWidth, margin: EdgeInsets.all(0), customCornerRaduis: false, diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 2b8ce40d..3526f57a 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -11,8 +11,9 @@ class DrawerItem extends StatefulWidget { final IconData icon; final Color color; final String assetLink; + final double drawerWidth; - DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); + DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -50,7 +51,7 @@ class _DrawerItemState extends State { marginLeft: 5, marginRight: 5, color:widget.color ??Color(0xFF2E303A), - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * 6, fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), From 8e656dbc0d3e3e648e380597cc928d0f8fae2755 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 31 May 2021 13:28:13 +0300 Subject: [PATCH 10/42] some design fixes --- lib/config/localized_values.dart | 2 +- .../auth/verification_methods_screen.dart | 131 +++++++++++------- lib/screens/home/dashboard_swipe_widget.dart | 91 ++++++------ lib/widgets/auth/method_type_card.dart | 10 +- .../auth/verification_methods_list.dart | 10 +- 5 files changed, 142 insertions(+), 102 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 231e7f9b..aeddd5ca 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -568,7 +568,7 @@ const Map> localizedValues = { 'ar': "ليس هناك شكوى رئيس" }, "more-verify": { - "en": "More Verification Options", + "en": "More Verification \n Options", "ar": "المزيد من خيارات التحقق" }, "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"}, diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 1c9d7c13..98fc2e9e 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -130,57 +130,90 @@ class _VerificationMethodsScreenState extends State { ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - children: [ - - Text( - TranslationBase.of(context) - .lastLoginAt, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700,), - - ), - Row( - children: [ - AppText( - TranslationBase - .of(context) - .verifyWith, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - AppText( - authenticationViewModel.getType( - authenticationViewModel.user - .logInTypeID, - context), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, + Container( + width: SizeConfig.realScreenWidth * .5, + padding: EdgeInsets.all(0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context) + .lastLoginAt, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + ), + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.55, + child: RichText( + text: TextSpan( + text: TranslationBase.of(context) + .verifyWith, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + fontFamily: 'Poppins', + ), + children: [ + TextSpan( + text: authenticationViewModel + .getType( + authenticationViewModel + .user + .logInTypeID, + context), + style: TextStyle( + color: + Color(0xFF2B353E), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + fontFamily: 'Poppins', + fontWeight: + FontWeight.w700, + ), + ) + ]), + ), + ), + ], + crossAxisAlignment: + CrossAxisAlignment.start, + ), ), - ], - ) - ], - crossAxisAlignment: CrossAxisAlignment.start,), - Column(children: [ - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( + Column( + mainAxisAlignment: MainAxisAlignment.start, + + children: [ + AppText( + authenticationViewModel + .user.editedOn != + null + ? AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + authenticationViewModel + .user + .editedOn)) + : authenticationViewModel + .user.createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate(authenticationViewModel.user .createdOn)) : '--', diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 281b8c7c..7782832c 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,3 +1,4 @@ +import 'package:charts_flutter/flutter.dart' as charts; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; @@ -10,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:charts_flutter/flutter.dart' as charts; class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; @@ -48,36 +48,36 @@ class _DashboardSwipeWidgetState extends State { // itemHeight: 300, pagination: new SwiperCustomPagination( builder: (BuildContext context, SwiperPluginConfig config) { - return new Stack( - alignment: Alignment.bottomCenter, - children: [ - Positioned( - bottom: 0, - child: Center( - child: InkWell( - onTap: () {}, - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - config.activeIndex == 0 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - config.activeIndex == 1 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - config.activeIndex == 2 - ? SwiperRoundedPagination(true) - : SwiperRoundedPagination(false), - ], + return new Stack( + alignment: Alignment.bottomCenter, + children: [ + Positioned( + bottom: 0, + child: Center( + child: InkWell( + onTap: () {}, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + config.activeIndex == 0 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 1 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 2 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + ], + ), + ), ), ), - ), - ), - ) - ], - ); - }), + ) + ], + ); + }), viewportFraction: 0.9, // scale: 0.9, // control: new SwiperControl(), @@ -88,16 +88,20 @@ class _DashboardSwipeWidgetState extends State { Widget getSwipeWidget(List dashboardItemList, int index) { if (index == 1) return RoundedContainer( - raduis: 16, - showBorder: true, - borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[1]))); + raduis: 16, + showBorder: true, + borderColor: Colors.white, + shadowWidth: 0.2, + shadowSpreadRadius: 3, + shadowDy: 1, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: GetOutPatientStack( + dashboardItemList[1], + ), + ), + ); if (index == 0) return RoundedContainer( raduis: 16, @@ -120,7 +124,7 @@ class _DashboardSwipeWidgetState extends State { shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 1, child: Row( @@ -137,9 +141,9 @@ class _DashboardSwipeWidgetState extends State { padding: EdgeInsets.all(8), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context) @@ -228,8 +232,7 @@ class _DashboardSwipeWidgetState extends State { return Container(); } - static List> _createReferralData( - List dashboardItemList) { + static List> _createReferralData(List dashboardItemList) { final data = [ new GaugeSegment( dashboardItemList[2].summaryoptions[0].kPIParameter, diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 1945546a..d7c9a2e0 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -17,6 +17,7 @@ class MethodTypeCard extends StatelessWidget { @override Widget build(BuildContext context) { + double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 22 : 15); return InkWell( onTap: onTap, child: Container( @@ -30,7 +31,7 @@ class MethodTypeCard extends StatelessWidget { color: HexColor('#707070'), width: 0.1), ), - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 22 : 15), + height: cardHeight, child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -38,10 +39,13 @@ class MethodTypeCard extends StatelessWidget { children: [ Row( mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( assetPath, width: SizeConfig.widthMultiplier* 12, + height: cardHeight * 0.35, + // height: , ), ], ), @@ -50,8 +54,8 @@ class MethodTypeCard extends StatelessWidget { ), AppText( label, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 2.5, - color: Color(0xFF2E303A), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 3, + color: Color(0xFF2B353E), fontWeight: FontWeight.bold, ) ], diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 264fefb3..0e9fe7b8 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -42,7 +42,7 @@ class _VerificationMethodsListState extends State { {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, label: TranslationBase .of(context) - .verifyWith+ TranslationBase.of(context).verifyWhatsApp, + .verifyWith+"\n"+ TranslationBase.of(context).verifyWhatsApp, ); break; case AuthMethodTypes.SMS: @@ -51,7 +51,7 @@ class _VerificationMethodsListState extends State { onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, label:TranslationBase .of(context) - .verifyWith+ TranslationBase.of(context).verifySMS, + .verifyWith+ "\n"+ TranslationBase.of(context).verifySMS, ); break; case AuthMethodTypes.Fingerprint: @@ -66,7 +66,7 @@ class _VerificationMethodsListState extends State { }, label: TranslationBase .of(context) - .verifyWith+TranslationBase.of(context).verifyFingerprint, + .verifyWith+"\n"+TranslationBase.of(context).verifyFingerprint, ); break; case AuthMethodTypes.FaceID: @@ -80,7 +80,7 @@ class _VerificationMethodsListState extends State { }, label: TranslationBase .of(context) - .verifyWith+TranslationBase.of(context).verifyFaceID, + .verifyWith+"\n"+TranslationBase.of(context).verifyFaceID, ); break; @@ -89,7 +89,7 @@ class _VerificationMethodsListState extends State { assetPath: 'assets/images/login/more_icon.png', onTap: widget.onShowMore, label: TranslationBase.of(context).moreVerification, - height: 40, + // height: 40, ); } } From 70020f35c9f2311082d0b3e59659d8863ae40c2f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 31 May 2021 13:42:40 +0300 Subject: [PATCH 11/42] fixes in dashboard --- lib/screens/home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/home_screen.dart | 5 ++++- lib/widgets/dashboard/activity_button.dart | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 1bc65f2e..11c46eb3 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -24,7 +24,7 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:15), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:12), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 94cad8f2..35961b4b 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -248,7 +248,10 @@ class _HomeScreenState extends State { model.dashboardItemsList[3]) : DashboardSliderItemWidget( model.dashboardItemsList[6]), - ]))) + ], + ), + ), + ) : SizedBox(), FractionallySizedBox( // widthFactor: 0.90, diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index ed38de96..25b925b2 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -21,7 +21,7 @@ class GetActivityCard extends StatelessWidget { padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( value.value.toString(), From 8d2252ecdf36e0dc748c014037ed19ffc0fd8549 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 31 May 2021 16:43:40 +0300 Subject: [PATCH 12/42] fixes --- .../viewModel/authentication_view_model.dart | 31 ++++--- lib/root_page.dart | 5 ++ .../home/dashboard_slider-item-widget.dart | 4 +- lib/screens/home/dashboard_swipe_widget.dart | 80 ++++++++++--------- ...ctivity_button.dart => activity_card.dart} | 4 +- lib/widgets/dashboard/row_count.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 29 ++++++- .../shared/bottom_navigation_item.dart | 2 +- 8 files changed, 100 insertions(+), 57 deletions(-) rename lib/widgets/dashboard/{activity_button.dart => activity_card.dart} (92%) diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 4e8217d3..c90eb1a4 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -415,16 +415,27 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { - DEVICE_TOKEN = ""; - String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - this.isFromLogin = isFromLogin; - app_status = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + + + try { + DEVICE_TOKEN = ""; + String lang = await sharedPref.getString(APP_Language); + String errr = await sharedPref.getString("LogOut Error"); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + sharedPref.setString("LogOut Error", errr); + + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + app_status = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); + } + + catch (e) { + sharedPref.setString("LogOut Error", e); + } Navigator.pushAndRemoveUntil( AppGlobal.CONTEX, FadePage( diff --git a/lib/root_page.dart b/lib/root_page.dart index 35a3fa44..552289a0 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -13,8 +13,13 @@ import 'landing_page.dart'; class RootPage extends StatelessWidget { @override Widget build(BuildContext context) { + + AuthenticationViewModel authenticationViewModel = Provider.of(context); Widget buildRoot() { + sharedPref.getString("LogOut Error").then((error){ + }); + switch (authenticationViewModel.status) { case APP_STATUS.LOADING: return Scaffold( diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 11c46eb3..de647654 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/activity_card.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -24,7 +24,7 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:12), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 7782832c..91544315 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -28,9 +28,10 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { + double height = SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 40 : 30); return Container( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 40 : 30), + height: height, // height: 230, child: Swiper( onIndexChanged: (index) { @@ -42,7 +43,7 @@ class _DashboardSwipeWidgetState extends State { } }, itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(widget.dashboardItemList, index); + return getSwipeWidget(widget.dashboardItemList, index, height); }, itemCount: 3, // itemHeight: 300, @@ -85,7 +86,7 @@ class _DashboardSwipeWidgetState extends State { ); } - Widget getSwipeWidget(List dashboardItemList, int index) { + Widget getSwipeWidget(List dashboardItemList, int index, double height) { if (index == 1) return RoundedContainer( raduis: 16, @@ -124,10 +125,16 @@ class _DashboardSwipeWidgetState extends State { shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + + children: [ Expanded( flex: 1, child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Expanded( flex: 4, @@ -158,44 +165,41 @@ class _DashboardSwipeWidgetState extends State { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, fontWeight: FontWeight.bold, ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightShort?0: 7) + ) ], - )), + ),), Expanded( flex: 1, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), - ), + RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + Colors.black), + RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Colors.grey), + RowCounts( + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Colors.red), ], ), ) @@ -206,6 +210,8 @@ class _DashboardSwipeWidgetState extends State { flex: 3, child: Stack(children: [ Container( + padding:EdgeInsets.all(0), + child: GaugeChart( _createReferralData(widget.dashboardItemList))), Positioned( @@ -221,7 +227,7 @@ class _DashboardSwipeWidgetState extends State { ) ], ), - top: MediaQuery.of(context).size.height * 0.13, + top: height * .35, left: 0, right: 0) ]), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_card.dart similarity index 92% rename from lib/widgets/dashboard/activity_button.dart rename to lib/widgets/dashboard/activity_card.dart index 25b925b2..5181de42 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -25,14 +25,14 @@ class GetActivityCard extends StatelessWidget { children: [ AppText( value.value.toString(), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 25, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), ), AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 09, color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a23fb8b9..7fb9a96a 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -33,7 +33,7 @@ class RowCounts extends StatelessWidget { ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontWeight: FontWeight.bold, ) ], diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 820c63cb..36df29a8 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -203,10 +203,31 @@ class _AppDrawerState extends State { ), onTap: () async { - Navigator.pop(context); - GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.logout(isFromLogin: false); - // GifLoaderDialogUtils.showMyDialog(context); + try { + + Navigator.pop(context); + GifLoaderDialogUtils.showMyDialog(context); + await authenticationViewModel.logout(isFromLogin: false); + // GifLoaderDialogUtils.hideDialog(context); + + + } + + catch (err) { + + // show the dialog + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + content: Text(err.toString()), + ); + }, + ); + + // code for handling exception + } + }, ), ], diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index c676d344..bd338866 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -35,7 +35,7 @@ class BottomNavigationItem extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8) ) * 10,), + (SizeConfig.isHeightShort ? 12 : 9) ) * 10,), Container( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index From 49afc338d674bcf4628d819392acc13aad189088 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 1 Jun 2021 10:47:58 +0300 Subject: [PATCH 13/42] fix drawer in big screen --- lib/widgets/shared/app_drawer_widget.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 36df29a8..e387ac8a 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -51,10 +51,10 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * 30, + width: drawerWidth) * (SizeConfig.isHeightShort? 30: 35), ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 1, bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), ), Container( child: InkWell( @@ -66,13 +66,13 @@ class _AppDrawerState extends State { size: SizeConfig.heightMultiplier * 3, ), ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2, bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?2:3), bottom: SizeConfig.heightMultiplier * 0.5), ) ], crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, ), - SizedBox(height: SizeConfig.heightMultiplier * 0.5,), + SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?0.5:1),), if (authenticationViewModel.doctorProfile != null) InkWell( onTap: () { @@ -116,7 +116,7 @@ class _AppDrawerState extends State { ], ), ), - SizedBox(height: SizeConfig.heightMultiplier * 4,), + SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?4:6),), InkWell( child: DrawerItem( TranslationBase @@ -163,7 +163,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier * 5, + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?5:9), ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -192,7 +192,7 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), - SizedBox(height: SizeConfig.heightMultiplier *0.5 ), + SizedBox(height: SizeConfig.heightMultiplier *(SizeConfig.isHeightShort?0.5:1) ), InkWell( child: DrawerItem( TranslationBase From 19bac417c4bea5c169cd19fd204960c0030bad4c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 1 Jun 2021 12:11:27 +0300 Subject: [PATCH 14/42] fix login issue --- .../viewModel/authentication_view_model.dart | 38 +++++++------------ lib/core/viewModel/base_view_model.dart | 1 + lib/root_page.dart | 2 - .../auth/verification_methods_screen.dart | 10 ++--- lib/widgets/shared/app_drawer_widget.dart | 2 +- 5 files changed, 20 insertions(+), 33 deletions(-) diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index c90eb1a4..4a6d105c 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -17,14 +17,12 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; import 'package:doctor_app_flutter/root_page.dart'; -import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -34,7 +32,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:provider/provider.dart'; enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } @@ -76,7 +73,7 @@ class AuthenticationViewModel extends BaseViewModel { APP_STATUS app_status = APP_STATUS.LOADING; AuthenticationViewModel({bool checkDeviceInfo = false}) { - getDeviceInfoFromFirebase(); + getDeviceInfoFromFirebase(); getDoctorProfile(); } @@ -303,7 +300,7 @@ class AuthenticationViewModel extends BaseViewModel { license: true, projectID: clinicInfo.projectID, tokenID: '', - languageID: 2); + languageID: 2);//TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error; @@ -362,7 +359,12 @@ class AuthenticationViewModel extends BaseViewModel { if (Platform.isIOS) { _firebaseMessaging.requestNotificationPermissions(); } - setState(ViewState.Busy); + + try { + setState(ViewState.Busy); + } catch (e) { + Helpers.showErrorToast("fdfdfdfdf"+e.toString()); + } var token = await _firebaseMessaging.getToken(); if (DEVICE_TOKEN == "") { DEVICE_TOKEN = token; @@ -416,39 +418,25 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { - - try { - DEVICE_TOKEN = ""; + DEVICE_TOKEN = ""; String lang = await sharedPref.getString(APP_Language); - String errr = await sharedPref.getString("LogOut Error"); + await Helpers.clearSharedPref(); doctorProfile = null; sharedPref.setString(APP_Language, lang); - sharedPref.setString("LogOut Error", errr); - deleteUser(); - await getDeviceInfoFromFirebase(); + await getDeviceInfoFromFirebase(); + + this.isFromLogin = isFromLogin; app_status = APP_STATUS.UNAUTHENTICATED; setState(ViewState.Idle); - } - - catch (e) { - sharedPref.setString("LogOut Error", e); - } - Navigator.pushAndRemoveUntil( - AppGlobal.CONTEX, - FadePage( - page: RootPage(), - ), - (r) => false); } deleteUser(){ user = null; unverified = false; isLogin = false; - // notifyListeners(); } } diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index 9d4fe36d..9d7032aa 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -50,5 +50,6 @@ class BaseViewModel extends ChangeNotifier { setDoctorProfile(DoctorProfileModel doctorProfile)async { await sharedPref.setObj(DOCTOR_PROFILE, doctorProfile); this.doctorProfile = doctorProfile; + notifyListeners(); } } diff --git a/lib/root_page.dart b/lib/root_page.dart index 552289a0..c87eb373 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -17,8 +17,6 @@ class RootPage extends StatelessWidget { AuthenticationViewModel authenticationViewModel = Provider.of(context); Widget buildRoot() { - sharedPref.getString("LogOut Error").then((error){ - }); switch (authenticationViewModel.status) { case APP_STATUS.LOADING: diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 98fc2e9e..2cc5b95f 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -58,6 +58,8 @@ class _VerificationMethodsScreenState extends State { projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); + + return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -582,6 +584,8 @@ class _VerificationMethodsScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { await authenticationViewModel.onCheckActivationCodeSuccess(); + Navigator.pop(context); + Navigator.pop(context); navigateToLandingPage(); } } @@ -590,11 +594,7 @@ class _VerificationMethodsScreenState extends State { if (authenticationViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(authenticationViewModel.error); } else { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), (r) => false); + authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED); } } diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index e387ac8a..4bc783ac 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -206,7 +206,7 @@ class _AppDrawerState extends State { try { Navigator.pop(context); - GifLoaderDialogUtils.showMyDialog(context); + //GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.logout(isFromLogin: false); // GifLoaderDialogUtils.hideDialog(context); From 00aa2c3752065d71fcb6892d34cab9a9d80aaffa Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 1 Jun 2021 14:34:10 +0300 Subject: [PATCH 15/42] fix homepage screen --- .../viewModel/authentication_view_model.dart | 26 +++++++---------- lib/widgets/auth/method_type_card.dart | 18 ++++-------- lib/widgets/dashboard/activity_card.dart | 5 ++-- lib/widgets/shared/app_drawer_widget.dart | 29 ++----------------- 4 files changed, 22 insertions(+), 56 deletions(-) diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 4a6d105c..87ba86f5 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -22,13 +22,10 @@ import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; -import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; @@ -299,8 +296,7 @@ class AuthenticationViewModel extends BaseViewModel { clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, - tokenID: '', - languageID: 2);//TODO change the lan + tokenID: '',); await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error; @@ -419,18 +415,16 @@ class AuthenticationViewModel extends BaseViewModel { logout({bool isFromLogin = false}) async { DEVICE_TOKEN = ""; - String lang = await sharedPref.getString(APP_Language); + String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - - - this.isFromLogin = isFromLogin; - app_status = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + app_status = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); } deleteUser(){ diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index d7c9a2e0..d02d8dc7 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -35,19 +35,13 @@ class MethodTypeCard extends StatelessWidget { child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - assetPath, - width: SizeConfig.widthMultiplier* 12, - height: cardHeight * 0.35, - // height: , - ), - ], + Image.asset( + assetPath, + width: SizeConfig.widthMultiplier* 12, + height: cardHeight * 0.35, + // height: , ), SizedBox( height:height , diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 5181de42..e3c1fe8f 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -10,9 +10,10 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { return Container( + //TODO change it to make it depend on width width: MediaQuery.of(context).size.height * 0.125, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), + padding: EdgeInsets.all(SizeConfig.heightMultiplier * .3), + margin: EdgeInsets.all(SizeConfig.heightMultiplier * .5), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 4bc783ac..3145da2d 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -51,7 +51,7 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightShort? 30: 35), + width: drawerWidth) * (SizeConfig.isHeightShort? 30: 32), ), margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), @@ -63,7 +63,7 @@ class _AppDrawerState extends State { }, child: Icon( DoctorApp.close_1, - size: SizeConfig.heightMultiplier * 3, + size: SizeConfig.heightMultiplier * 2, ), ), margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?2:3), bottom: SizeConfig.heightMultiplier * 0.5), @@ -163,7 +163,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?5:9), + height: SizeConfig.heightMultiplier *(SizeConfig.isHeightShort?10:16), ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -203,31 +203,8 @@ class _AppDrawerState extends State { ), onTap: () async { - try { - Navigator.pop(context); - //GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.logout(isFromLogin: false); - // GifLoaderDialogUtils.hideDialog(context); - - - } - - catch (err) { - - // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - content: Text(err.toString()), - ); - }, - ); - - // code for handling exception - } - }, ), ], From 4a9748739ec9a6bb754cec772e70797f1b74b6f2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 11:25:31 +0300 Subject: [PATCH 16/42] improve home design --- ios/Podfile.lock | 327 ------------------ .../home/dashboard_slider-item-widget.dart | 4 +- lib/screens/home/home_page_card.dart | 6 +- lib/screens/home/home_patient_card.dart | 14 +- lib/screens/home/home_screen.dart | 2 +- lib/widgets/dashboard/activity_card.dart | 46 +-- 6 files changed, 38 insertions(+), 361 deletions(-) delete mode 100644 ios/Podfile.lock diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 9301d419..00000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,327 +0,0 @@ -PODS: - - Alamofire (5.4.3) - - barcode_scan_fix (0.0.1): - - Flutter - - MTBBarcodeScanner - - connectivity (0.0.1): - - Flutter - - Reachability - - connectivity_for_web (0.1.0): - - Flutter - - connectivity_macos (0.0.1): - - Flutter - - device_info (0.0.1): - - Flutter - - Firebase/CoreOnly (6.33.0): - - FirebaseCore (= 6.10.3) - - Firebase/Messaging (6.33.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.3): - - Firebase/CoreOnly (~> 6.33.0) - - Flutter - - firebase_core_web (0.1.0): - - Flutter - - firebase_messaging (7.0.3): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Messaging (~> 6.33.0) - - firebase_core - - Flutter - - FirebaseCore (6.10.3): - - FirebaseCoreDiagnostics (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - FirebaseCoreDiagnostics (1.7.0): - - GoogleDataTransport (~> 7.4) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - nanopb (~> 1.30906.0) - - FirebaseInstallations (1.7.0): - - FirebaseCore (~> 6.10) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - PromisesObjC (~> 1.2) - - FirebaseInstanceID (4.8.0): - - FirebaseCore (~> 6.10) - - FirebaseInstallations (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - FirebaseMessaging (4.7.1): - - FirebaseCore (~> 6.10) - - FirebaseInstanceID (~> 4.7) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Reachability (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - Protobuf (>= 3.9.2, ~> 3.9) - - Flutter (1.0.0) - - flutter_flexible_toast (0.0.1): - - Flutter - - flutter_inappwebview (0.0.1): - - Flutter - - flutter_plugin_android_lifecycle (0.0.1): - - Flutter - - GoogleDataTransport (7.5.1): - - nanopb (~> 1.30906.0) - - GoogleUtilities/AppDelegateSwizzler (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (6.7.2): - - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Network (6.7.2): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.7.2)" - - GoogleUtilities/Reachability (6.7.2): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.7.2): - - GoogleUtilities/Logger - - hexcolor (0.0.1): - - Flutter - - imei_plugin (0.0.1): - - Flutter - - local_auth (0.0.1): - - Flutter - - maps_launcher (0.0.1): - - Flutter - - MTBBarcodeScanner (5.0.11) - - nanopb (1.30906.0): - - nanopb/decode (= 1.30906.0) - - nanopb/encode (= 1.30906.0) - - nanopb/decode (1.30906.0) - - nanopb/encode (1.30906.0) - - OpenTok (2.15.3) - - path_provider_linux (0.0.1): - - Flutter - - path_provider_windows (0.0.1): - - Flutter - - "permission_handler (5.1.0+2)": - - Flutter - - PromisesObjC (1.2.12) - - Protobuf (3.17.0) - - Reachability (3.2) - - screen (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - shared_preferences_linux (0.0.1): - - Flutter - - shared_preferences_macos (0.0.1): - - Flutter - - shared_preferences_web (0.0.1): - - Flutter - - shared_preferences_windows (0.0.1): - - Flutter - - speech_to_text (0.0.1): - - Flutter - - Try - - Try (2.1.1) - - url_launcher (0.0.1): - - Flutter - - url_launcher_linux (0.0.1): - - Flutter - - url_launcher_macos (0.0.1): - - Flutter - - url_launcher_web (0.0.1): - - Flutter - - url_launcher_windows (0.0.1): - - Flutter - - video_player (0.0.1): - - Flutter - - video_player_web (0.0.1): - - Flutter - - wakelock (0.0.1): - - Flutter - - webview_flutter (0.0.1): - - Flutter - -DEPENDENCIES: - - Alamofire (~> 5.2) - - barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`) - - connectivity (from `.symlinks/plugins/connectivity/ios`) - - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - - device_info (from `.symlinks/plugins/device_info/ios`) - - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - - Flutter (from `Flutter`) - - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - - hexcolor (from `.symlinks/plugins/hexcolor/ios`) - - imei_plugin (from `.symlinks/plugins/imei_plugin/ios`) - - local_auth (from `.symlinks/plugins/local_auth/ios`) - - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - - OpenTok - - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) - - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) - - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) - - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) - - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) - - video_player (from `.symlinks/plugins/video_player/ios`) - - video_player_web (from `.symlinks/plugins/video_player_web/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) - - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) - -SPEC REPOS: - trunk: - - Alamofire - - Firebase - - FirebaseCore - - FirebaseCoreDiagnostics - - FirebaseInstallations - - FirebaseInstanceID - - FirebaseMessaging - - GoogleDataTransport - - GoogleUtilities - - MTBBarcodeScanner - - nanopb - - OpenTok - - PromisesObjC - - Protobuf - - Reachability - - Try - -EXTERNAL SOURCES: - barcode_scan_fix: - :path: ".symlinks/plugins/barcode_scan_fix/ios" - connectivity: - :path: ".symlinks/plugins/connectivity/ios" - connectivity_for_web: - :path: ".symlinks/plugins/connectivity_for_web/ios" - connectivity_macos: - :path: ".symlinks/plugins/connectivity_macos/ios" - device_info: - :path: ".symlinks/plugins/device_info/ios" - firebase_core: - :path: ".symlinks/plugins/firebase_core/ios" - firebase_core_web: - :path: ".symlinks/plugins/firebase_core_web/ios" - firebase_messaging: - :path: ".symlinks/plugins/firebase_messaging/ios" - Flutter: - :path: Flutter - flutter_flexible_toast: - :path: ".symlinks/plugins/flutter_flexible_toast/ios" - flutter_inappwebview: - :path: ".symlinks/plugins/flutter_inappwebview/ios" - flutter_plugin_android_lifecycle: - :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" - hexcolor: - :path: ".symlinks/plugins/hexcolor/ios" - imei_plugin: - :path: ".symlinks/plugins/imei_plugin/ios" - local_auth: - :path: ".symlinks/plugins/local_auth/ios" - maps_launcher: - :path: ".symlinks/plugins/maps_launcher/ios" - path_provider_linux: - :path: ".symlinks/plugins/path_provider_linux/ios" - path_provider_windows: - :path: ".symlinks/plugins/path_provider_windows/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" - screen: - :path: ".symlinks/plugins/screen/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - shared_preferences_linux: - :path: ".symlinks/plugins/shared_preferences_linux/ios" - shared_preferences_macos: - :path: ".symlinks/plugins/shared_preferences_macos/ios" - shared_preferences_web: - :path: ".symlinks/plugins/shared_preferences_web/ios" - shared_preferences_windows: - :path: ".symlinks/plugins/shared_preferences_windows/ios" - speech_to_text: - :path: ".symlinks/plugins/speech_to_text/ios" - url_launcher: - :path: ".symlinks/plugins/url_launcher/ios" - url_launcher_linux: - :path: ".symlinks/plugins/url_launcher_linux/ios" - url_launcher_macos: - :path: ".symlinks/plugins/url_launcher_macos/ios" - url_launcher_web: - :path: ".symlinks/plugins/url_launcher_web/ios" - url_launcher_windows: - :path: ".symlinks/plugins/url_launcher_windows/ios" - video_player: - :path: ".symlinks/plugins/video_player/ios" - video_player_web: - :path: ".symlinks/plugins/video_player_web/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" - webview_flutter: - :path: ".symlinks/plugins/webview_flutter/ios" - -SPEC CHECKSUMS: - Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9 - barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1 - connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 - connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b - connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 - device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 - firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 - firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 - FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 - FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 - FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 - flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189 - flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 - imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd - local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd - maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc - OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 - path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 - path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 - PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 - Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 - shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d - shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 - shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 - shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 - shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae - speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe - Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef - url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 - url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 - url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c - url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 - video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 - wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 - webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 - -PODFILE CHECKSUM: d0a3789a37635365b4345e456835ed9d30398217 - -COCOAPODS: 1.10.0.rc.1 diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index de647654..f8783c9a 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -18,13 +18,13 @@ class DashboardSliderItemWidget extends StatelessWidget { children: [ AppText( item.kPIName, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, fontWeight: FontWeight.bold, ), ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:11), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 6ad22c3a..903bdafd 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -11,7 +10,7 @@ class HomePageCard extends StatelessWidget { Key key, this.color, this.opacity = 0.4, - this.margin}) + this.margin, this.width}) : super(key: key); final bool hasBorder; final String imageName; @@ -19,13 +18,14 @@ class HomePageCard extends StatelessWidget { final Function onTap; final Color color; final double opacity; + final double width; final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( onTap: onTap, child: Container( - width: SizeConfig.widthMultiplier * 30, + width: width, margin: this.margin, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index a0a24b89..23072d17 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,8 +22,10 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11); return HomePageCard( color: backgroundColor, + width: width, margin: EdgeInsets.all(4), child: Container( padding: EdgeInsets.all(8), @@ -35,13 +37,13 @@ class HomePatientCard extends StatelessWidget { child: Stack( children: [ Positioned( - bottom: 0.01, + bottom: 0.02, right: 0.2, - width: 10.0, - height: 25.0, + width: SizeConfig.getWidthMultiplier(width: width) * 10, + height: SizeConfig.getWidthMultiplier(width: width) * 15, child: Icon( cardIcon, - size: SizeConfig.widthMultiplier* 15, + size: SizeConfig.getWidthMultiplier(width: width) * 40, color: backgroundIconColor, ), ), @@ -52,7 +54,7 @@ class HomePatientCard extends StatelessWidget { children: [ Icon( cardIcon, - size: SizeConfig.widthMultiplier* 8, + size: SizeConfig.getWidthMultiplier(width: width) * 20, color: textColor, ), SizedBox( @@ -70,7 +72,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * 12, ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 35961b4b..9c72def3 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -291,7 +291,7 @@ class _HomeScreenState extends State { height: SizeConfig.heightMultiplier *1, ), Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:15), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index e3c1fe8f..8b191c3b 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -9,9 +9,9 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12); return Container( - //TODO change it to make it depend on width - width: MediaQuery.of(context).size.height * 0.125, + width: width, padding: EdgeInsets.all(SizeConfig.heightMultiplier * .3), margin: EdgeInsets.all(SizeConfig.heightMultiplier * .5), decoration: BoxDecoration( @@ -19,26 +19,28 @@ class GetActivityCard extends StatelessWidget { borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - value.value.toString(), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 25, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 09, - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - ), - ], + padding: const EdgeInsets.fromLTRB(8,4, 8, 4), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + value.value.toString(), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 08, + color: Color(0xFF2B353E), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + ), + ], + ), ), ), ); From 01abd02d19f2701b6474ecebfaf8f6e86a178d68 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 14:55:32 +0300 Subject: [PATCH 17/42] move referral patient --- .../home/dashboard_referral_patient.dart | 174 ++++++++++++++++++ .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/dashboard_swipe_widget.dart | 160 +--------------- lib/screens/home/home_patient_card.dart | 4 +- lib/screens/home/home_screen.dart | 10 +- lib/widgets/dashboard/activity_card.dart | 6 +- lib/widgets/dashboard/out_patient_stack.dart | 6 +- lib/widgets/dashboard/row_count.dart | 9 +- .../shared/bottom_navigation_item.dart | 8 +- 9 files changed, 204 insertions(+), 175 deletions(-) create mode 100644 lib/screens/home/dashboard_referral_patient.dart diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart new file mode 100644 index 00000000..16ef6595 --- /dev/null +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -0,0 +1,174 @@ + +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; + + +class DashboardReferralPatient extends StatelessWidget { + final List dashboardItemList; + final double height; + final DashboardViewModel model; + + const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + @override + Widget build(BuildContext context) { + return RoundedContainer( + raduis: 16, + showBorder: true, + borderColor: Colors.white, + shadowWidth: 0.2, + shadowSpreadRadius: 3, + shadowDy: 1, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + + children: [ + Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .patients, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontWeight: FontWeight.bold, + fontHeight: 0.5, + ), + AppText( + TranslationBase.of(context) + .referral, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightShort?14: 20) + ) + ], + ),), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + Colors.black, height: height,), + RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Colors.grey, height: height,), + RowCounts( + + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Colors.red, height: height,), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + padding:EdgeInsets.all(0), + + child: GaugeChart( + _createReferralData(dashboardItemList))), + Positioned( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + model + .getPatientCount(dashboardItemList[2]) + .toString(), + fontSize: SizeConfig.textMultiplier * 3.0, + fontWeight: FontWeight.bold, + ) + ], + ), + top: height * .35, + left: 0, + right: 0) + ]), + ), + ], + )), + ])); + } + static List> _createReferralData(List dashboardItemList) { + final data = [ + new GaugeSegment( + dashboardItemList[2].summaryoptions[0].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[0].value), + charts.MaterialPalette.black), + new GaugeSegment( + dashboardItemList[2].summaryoptions[1].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[1].value), + charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment( + dashboardItemList[2].summaryoptions[2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[2].value), + charts.MaterialPalette.red.shadeDefault), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + + static int getValue(value) { + return value == 0 ? 1 : value; + } + +} \ No newline at end of file diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index f8783c9a..a3fbaedb 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -24,7 +24,7 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:11), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?13:12), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 91544315..0315caf2 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,17 +1,14 @@ -import 'package:charts_flutter/flutter.dart' as charts; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; +import 'dashboard_referral_patient.dart'; + class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; final DashboardViewModel model; @@ -29,7 +26,7 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 40 : 30); + (SizeConfig.isHeightShort ? 40 : 37); return Container( height: height, // height: 230, @@ -46,7 +43,6 @@ class _DashboardSwipeWidgetState extends State { return getSwipeWidget(widget.dashboardItemList, index, height); }, itemCount: 3, - // itemHeight: 300, pagination: new SwiperCustomPagination( builder: (BuildContext context, SwiperPluginConfig config) { return new Stack( @@ -116,156 +112,12 @@ class _DashboardSwipeWidgetState extends State { padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) - return RoundedContainer( - raduis: 16, - showBorder: true, - borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - - children: [ - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .patients, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, - fontWeight: FontWeight.bold, - fontHeight: 0.5, - ), - AppText( - TranslationBase.of(context) - .referral, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightShort?0: 7) - ) - ], - ),), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), - RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), - RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), - ], - ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - padding:EdgeInsets.all(0), - - child: GaugeChart( - _createReferralData(widget.dashboardItemList))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - widget.model - .getPatientCount(dashboardItemList[2]) - .toString(), - fontSize: SizeConfig.textMultiplier * 3.0, - fontWeight: FontWeight.bold, - ) - ], - ), - top: height * .35, - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); return Container(); } - static List> _createReferralData(List dashboardItemList) { - final data = [ - new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), - charts.MaterialPalette.black), - new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), - charts.MaterialPalette.gray.shadeDefault), - new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), - charts.MaterialPalette.red.shadeDefault), - ]; - return [ - new charts.Series( - id: 'Segments', - domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, - data: data, - colorFn: (GaugeSegment segment, _) => segment.color, - ) - ]; - } - static int getValue(value) { - return value == 0 ? 1 : value; - } } + + diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 23072d17..09590ef2 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,7 +22,7 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?16:11); return HomePageCard( color: backgroundColor, width: width, @@ -72,7 +72,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightShort?10:12), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 9c72def3..a45332f0 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -119,7 +119,7 @@ class _HomeScreenState extends State { return Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.end, children: [ Column( mainAxisAlignment: @@ -142,8 +142,8 @@ class _HomeScreenState extends State { ), constraints: BoxConstraints( - minWidth: SizeConfig.widthMultiplier* 6, - minHeight: SizeConfig.widthMultiplier* 6, + minWidth: SizeConfig.widthMultiplier* 5.5, + minHeight: SizeConfig.widthMultiplier* 5, ), child: Center( child: AppText( @@ -157,7 +157,7 @@ class _HomeScreenState extends State { projectsProvider .isArabic ? SizeConfig.widthMultiplier* 3.5 - : SizeConfig.widthMultiplier* 4, + : SizeConfig.widthMultiplier* 3, textAlign: TextAlign .center, @@ -291,7 +291,7 @@ class _HomeScreenState extends State { height: SizeConfig.heightMultiplier *1, ), Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?16:11), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 8b191c3b..d64ef370 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -9,7 +9,7 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?13:12); return Container( width: width, padding: EdgeInsets.all(SizeConfig.heightMultiplier * .3), @@ -19,7 +19,7 @@ class GetActivityCard extends StatelessWidget { borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8,4, 8, 4), + padding: const EdgeInsets.fromLTRB(8,8, 8, 4), child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -34,7 +34,7 @@ class GetActivityCard extends StatelessWidget { AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 08, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightShort?6: 8), color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 41fe28e2..430f5698 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -33,6 +33,8 @@ class GetOutPatientStack extends StatelessWidget { } getStack(Summaryoptions value, max,context) { + double barHeight = SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 30 : 25); return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), @@ -55,7 +57,7 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, + height: max != 0 ? ((barHeight )* value.value) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), @@ -63,7 +65,7 @@ class GetOutPatientStack extends StatelessWidget { ), ), Container( - height: MediaQuery.of(context).size.height * 0.20, + height: barHeight, margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index 7fb9a96a..dcadb8be 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -5,12 +5,13 @@ import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; final int count; + final double height; final Color c; - RowCounts(this.name, this.count, this.c); + RowCounts(this.name, this.count, this.c, {this.height}); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(top: 5, bottom: 5), + padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -46,8 +47,8 @@ class RowCounts extends StatelessWidget { Widget dot(Color c) { return Container( - padding: EdgeInsets.all(5.0), - margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 2), + margin: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 1), decoration: BoxDecoration(color: c, shape: BoxShape.circle)); } } diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index bd338866..f85636ff 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -23,7 +23,7 @@ class BottomNavigationItem extends StatelessWidget { return Expanded( child: SizedBox( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8), + (SizeConfig.isHeightShort ? 10 : 6), child: Material( type: MaterialType.transparency, child: InkWell( @@ -42,16 +42,16 @@ class BottomNavigationItem extends StatelessWidget { ? Color(0xFF333C45) : Theme.of(context).dividerColor, size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8) ) * 40,), + (SizeConfig.isHeightShort ? 10 : 6) ) * 40,), ), SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8) ) * 0.5,), + (SizeConfig.isHeightShort ? 10 : 6) ) * 0.5,), Expanded( child: Text( name, style: TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: currentIndex == index ? Theme.of(context).primaryColor : Theme.of(context).dividerColor, From 08e104ca56219bebabce05d105528f5f0b65eb18 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 16:05:37 +0300 Subject: [PATCH 18/42] fix referral issues --- lib/screens/home/dashboard_referral_patient.dart | 2 +- lib/widgets/dashboard/activity_card.dart | 2 +- lib/widgets/dashboard/out_patient_stack.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 16ef6595..5e265303 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -131,7 +131,7 @@ class DashboardReferralPatient extends StatelessWidget { ) ], ), - top: height * .35, + top: height * .40, left: 0, right: 0) ]), diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index d64ef370..4bb46e40 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -12,7 +12,7 @@ class GetActivityCard extends StatelessWidget { double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?13:12); return Container( width: width, - padding: EdgeInsets.all(SizeConfig.heightMultiplier * .3), + padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), margin: EdgeInsets.all(SizeConfig.heightMultiplier * .5), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 430f5698..6ff1412d 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -34,7 +34,7 @@ class GetOutPatientStack extends StatelessWidget { getStack(Summaryoptions value, max,context) { double barHeight = SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 30 : 25); + (SizeConfig.isHeightShort ? 23 : 25); return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), From cc7fedc8f57ddb19fbd984e7de731c1403122a95 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 17:46:03 +0300 Subject: [PATCH 19/42] add middle screen height size --- lib/config/size_config.dart | 6 ++++-- lib/screens/auth/login_screen.dart | 5 ++--- .../auth/verification_methods_screen.dart | 14 +++----------- .../home/dashboard_referral_patient.dart | 4 ++-- .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/dashboard_swipe_widget.dart | 2 +- lib/screens/home/home_patient_card.dart | 4 ++-- lib/screens/home/home_screen.dart | 4 ++-- lib/widgets/auth/method_type_card.dart | 2 +- lib/widgets/auth/sms-popup.dart | 5 +---- lib/widgets/dashboard/activity_card.dart | 4 ++-- lib/widgets/dashboard/out_patient_stack.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 17 ++++++++--------- lib/widgets/shared/bottom_navigation_item.dart | 8 ++++---- lib/widgets/shared/drawer_item_widget.dart | 2 +- 15 files changed, 35 insertions(+), 46 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 2763091b..9179d99a 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -18,16 +18,18 @@ class SizeConfig { static bool isMobilePortrait = false; static bool isMobile = false; static bool isHeightShort = false; + static bool isHeightVeryShort = false; void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; - if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } - if (constraints.maxHeight < 800) { + if (constraints.maxHeight < 600) { + isHeightVeryShort = true; + } else if (constraints.maxHeight < 800) { isHeightShort = true; } if (orientation == Orientation.portrait) { diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index a982ae79..909bdb0b 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -34,7 +34,7 @@ class _LoginScreenState extends State { @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); - double textFieldHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightShort ?10:6); + double textFieldHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?10:SizeConfig.isHeightShort?8:6); return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), @@ -163,7 +163,7 @@ class _LoginScreenState extends State { children: [ AppButton( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 8 : 6), + (SizeConfig.isHeightVeryShort ? 8 : 6), hPadding: 1, title: TranslationBase.of(context).login, color: Color(0xFFD02127), @@ -175,7 +175,6 @@ class _LoginScreenState extends State { }, ), - // SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 1 : 3),) ], ), ), diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 2cc5b95f..54bf26a3 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -1,6 +1,5 @@ import 'dart:io' show Platform; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -13,21 +12,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../config/size_config.dart'; -import '../../landing_page.dart'; -import '../../root_page.dart'; -import '../../routes.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/helpers.dart'; import '../../widgets/auth/verification_methods_list.dart'; -import 'login_screen.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -72,7 +65,7 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?6:4), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?6:4), ), if(authenticationViewModel.isFromLogin) InkWell( @@ -86,7 +79,7 @@ class _VerificationMethodsScreenState extends State { Column( children: [ SizedBox( - height: SizeConfig.heightMultiplier*(SizeConfig.isHeightShort?3:4), + height: SizeConfig.heightMultiplier*(SizeConfig.isHeightVeryShort?3:4), ), authenticationViewModel.user != null && isMoreOption == false ? Column( @@ -439,7 +432,7 @@ class _VerificationMethodsScreenState extends State { color: Color(0xFFD02127), fontWeight: FontWeight.w700, - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 8 : 6), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 8 : 6), hPadding: 1, onPressed: () { @@ -448,7 +441,6 @@ class _VerificationMethodsScreenState extends State { }, ), - // SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 1 : 3),) ], ), ), diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 5e265303..c389b9d7 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -69,7 +69,7 @@ class DashboardReferralPatient extends StatelessWidget { fontWeight: FontWeight.bold, ), SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightShort?14: 20) + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?5:SizeConfig.isHeightShort?14: 20) ) ], ),), @@ -131,7 +131,7 @@ class DashboardReferralPatient extends StatelessWidget { ) ], ), - top: height * .40, + top: height * (SizeConfig.isHeightVeryShort?0.35:0.40), left: 0, right: 0) ]), diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index a3fbaedb..b28ded18 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -24,7 +24,7 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?13:12), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:12), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 0315caf2..5bd178e3 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -26,7 +26,7 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 40 : 37); + (SizeConfig.isHeightVeryShort ? 40 : 37); return Container( height: height, // height: 230, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 09590ef2..d6b278dd 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,7 +22,7 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?16:11); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightVeryShort?14:11); return HomePageCard( color: backgroundColor, width: width, @@ -72,7 +72,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightShort?10:12), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort?10:12), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index a45332f0..aa47e349 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -213,7 +213,7 @@ class _HomeScreenState extends State { ), isClinic: true, height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8), + (SizeConfig.isHeightVeryShort ? 10 : 8), ), ]) ])), @@ -291,7 +291,7 @@ class _HomeScreenState extends State { height: SizeConfig.heightMultiplier *1, ), Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?16:11), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:11), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index d02d8dc7..db3a724b 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -17,7 +17,7 @@ class MethodTypeCard extends StatelessWidget { @override Widget build(BuildContext context) { - double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 22 : 15); + double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : 15); return InkWell( onTap: onTap, child: Container( diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index d2a65655..e93489ef 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -5,11 +5,8 @@ import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class SMSOTP { final AuthMethodTypes type; final mobileNo; @@ -50,7 +47,7 @@ class SMSOTP { bool isClosed = false; displayDialog(BuildContext context) async { double dialogWidth = MediaQuery.of(context).size.width * 0.90; - double dialogHeight = SizeConfig.isHeightShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40; + double dialogHeight = SizeConfig.isHeightVeryShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40; return showDialog( context: context, builder: (ctx) => Center( diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 4bb46e40..193f572d 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -9,7 +9,7 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?13:12); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:12); return Container( width: width, padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), @@ -34,7 +34,7 @@ class GetActivityCard extends StatelessWidget { AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightShort?6: 8), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 8), color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 6ff1412d..6ada94f1 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -34,7 +34,7 @@ class GetOutPatientStack extends StatelessWidget { getStack(Summaryoptions value, max,context) { double barHeight = SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 23 : 25); + (SizeConfig.isHeightVeryShort ? 23 : 25); return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index e44b6737..ee74590f 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.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/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; @@ -51,10 +50,10 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightShort? 30: 32), + width: drawerWidth) * (SizeConfig.isHeightVeryShort? 25:SizeConfig.isHeightVeryShort?30: 32), ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), ), Container( child: InkWell( @@ -66,13 +65,13 @@ class _AppDrawerState extends State { size: SizeConfig.heightMultiplier * 2, ), ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?2:3), bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?2:3), bottom: SizeConfig.heightMultiplier * 0.5), ) ], crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, ), - SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?0.5:1),), + SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?0.5:1),), if (authenticationViewModel.doctorProfile != null) InkWell( onTap: () { @@ -116,7 +115,7 @@ class _AppDrawerState extends State { ], ), ), - SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?4:6),), + SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?4:6),), InkWell( child: DrawerItem( TranslationBase @@ -154,7 +153,7 @@ class _AppDrawerState extends State { // height: 80, child: Image.asset('assets/images/qr_code.png', width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * 30, + width: drawerWidth) * (SizeConfig.isHeightVeryShort?25:30), ), ), onTap: () {}, @@ -163,7 +162,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier *(SizeConfig.isHeightShort?10:16), + height: SizeConfig.heightMultiplier *(SizeConfig.isHeightVeryShort?8:SizeConfig.isHeightShort?10:16), ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -192,7 +191,7 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), - SizedBox(height: SizeConfig.heightMultiplier *(SizeConfig.isHeightShort?0.5:1) ), + SizedBox(height: SizeConfig.heightMultiplier *(SizeConfig.isHeightVeryShort?0.5:1) ), InkWell( child: DrawerItem( TranslationBase diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index f85636ff..f34802a9 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -23,7 +23,7 @@ class BottomNavigationItem extends StatelessWidget { return Expanded( child: SizedBox( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 6), + (SizeConfig.isHeightVeryShort ? 10 : 6), child: Material( type: MaterialType.transparency, child: InkWell( @@ -35,17 +35,17 @@ class BottomNavigationItem extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 12 : 9) ) * 10,), + (SizeConfig.isHeightVeryShort ? 12 : 9) ) * 10,), Container( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? Color(0xFF333C45) : Theme.of(context).dividerColor, size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 6) ) * 40,), + (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 40,), ), SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 6) ) * 0.5,), + (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 0.5,), Expanded( child: Text( name, diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 3526f57a..71021f5d 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -51,7 +51,7 @@ class _DrawerItemState extends State { marginLeft: 5, marginRight: 5, color:widget.color ??Color(0xFF2E303A), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * 6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * (SizeConfig.isHeightVeryShort?5:6), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), From a5ea23c38e37e62903ce6e46e1483a84eacd1479 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 3 Jun 2021 14:12:50 +0300 Subject: [PATCH 20/42] improve home page to match the xd --- lib/config/config.dart | 4 +- lib/screens/home/Label.dart | 41 +++ .../home/dashboard_referral_patient.dart | 20 +- .../home/dashboard_slider-item-widget.dart | 20 +- lib/screens/home/dashboard_swipe_widget.dart | 2 +- lib/screens/home/home_patient_card.dart | 2 +- lib/screens/home/home_screen.dart | 309 +++++------------- lib/screens/home/home_screen_header.dart | 205 ++++++++++++ lib/util/helpers.dart | 18 +- lib/widgets/dashboard/activity_card.dart | 2 +- lib/widgets/dashboard/out_patient_stack.dart | 15 +- .../shared/bottom_navigation_item.dart | 5 +- 12 files changed, 374 insertions(+), 269 deletions(-) create mode 100644 lib/screens/home/Label.dart create mode 100644 lib/screens/home/home_screen_header.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 0283577e..c8af8ad9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/screens/home/Label.dart b/lib/screens/home/Label.dart new file mode 100644 index 00000000..5d2338a5 --- /dev/null +++ b/lib/screens/home/Label.dart @@ -0,0 +1,41 @@ +// ignore: must_be_immutable + +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class Label extends StatelessWidget { + Label({ + Key key, this.firstLine, this.secondLine, this.color, + }) : super(key: key); + final String firstLine; + final String secondLine; + Color color; + + @override + Widget build(BuildContext context) { + if(color == null) { + color = Color(0xFF2E303A); + } + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstLine, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3 , + // fontWeight: FontWeight.bold, + color: color, + fontHeight: .5, + ), + AppText( + secondLine, + color: color, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + fontWeight: FontWeight.bold, + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index c389b9d7..7be28985 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -10,6 +10,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; +import 'Label.dart'; + class DashboardReferralPatient extends StatelessWidget { final List dashboardItemList; @@ -55,21 +57,13 @@ class DashboardReferralPatient extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context) - .patients, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, - fontWeight: FontWeight.bold, - fontHeight: 0.5, - ), - AppText( - TranslationBase.of(context) - .referral, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, - fontWeight: FontWeight.bold, + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?2: 2) ), + Label(firstLine:TranslationBase.of(context).patients ,secondLine:TranslationBase.of(context).referral,color: Color(0xFF2B353E), ), + SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?5:SizeConfig.isHeightShort?14: 20) + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?5:SizeConfig.isHeightShort?10: 12) ) ], ),), diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index b28ded18..3ffb5ae5 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,9 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_card.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; +import 'Label.dart'; + class DashboardSliderItemWidget extends StatelessWidget { final DashboardModel item; @@ -13,18 +15,18 @@ class DashboardSliderItemWidget extends StatelessWidget { Widget build(BuildContext context) { return Column( children: [ - Row( + Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - item.kPIName, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - fontWeight: FontWeight.bold, - ), + Label(firstLine:Helpers.getLabelFromKPI(item.kPIName) ,secondLine:Helpers.getNameFromKPI(item.kPIName), ), + ], ), - new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:12), + + + + new Container( + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:13), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 5bd178e3..1b5ce330 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -26,7 +26,7 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 40 : 37); + (SizeConfig.isHeightVeryShort ? 40 : 31); return Container( height: height, // height: 230, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index d6b278dd..0a24b4db 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,7 +22,7 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightVeryShort?14:11); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightVeryShort?14:13); return HomePageCard( color: backgroundColor, width: width, diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index aa47e349..603c20cd 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; @@ -17,19 +16,15 @@ import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_scre import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:sticky_headers/sticky_headers/widget.dart'; -import '../../widgets/shared/app_texts_widget.dart'; +import 'Label.dart'; +import 'home_screen_header.dart'; class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -48,7 +43,7 @@ class _HomeScreenState extends State { bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - var clinicId; + String clinicId; AuthenticationViewModel authenticationViewModel; int colorIndex = 0; @@ -72,240 +67,91 @@ class _HomeScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: HomeScreenHeader( + model: model, + ), body: ListView(children: [ Column(children: [ - StickyHeader( - header: Container( - color: Colors.grey[100], - child: Stack(children: [ - IconButton( - icon: Image.asset( - 'assets/images/menu.png', - width: SizeConfig.widthMultiplier * 7, - ), - iconSize: SizeConfig.heightMultiplier * 2, - color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), - ), - Column( - children: [ - ProfileWelcomeWidget( - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width * .6, - child: projectsProvider.doctorClinicsList.length > - 0 - ? Stack( - children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID - : clinicId, - iconSize: SizeConfig.widthMultiplier* 7, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Container( - padding: - EdgeInsets.all(2), - margin: - EdgeInsets.all(2), - decoration: - new BoxDecoration( - color: - Colors.red[800], - borderRadius: - BorderRadius - .circular( - 20), - ), - constraints: - BoxConstraints( - minWidth: SizeConfig.widthMultiplier* 5.5, - minHeight: SizeConfig.widthMultiplier* 5, - ), - child: Center( - child: AppText( - projectsProvider - .doctorClinicsList - .length - .toString(), - color: - Colors.white, - fontSize: - projectsProvider - .isArabic - ? SizeConfig.widthMultiplier* 3.5 - : SizeConfig.widthMultiplier* 3, - textAlign: - TextAlign - .center, - ), - )), - ], - ), - AppText(item.clinicName, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.width * .6) * 5, - color: Colors.black, - textOverflow:TextOverflow.ellipsis , - fontWeight: - FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (newValue) async { - clinicId = newValue; - GifLoaderDialogUtils.showMyDialog( - context); - await model.changeClinic(newValue, - authenticationViewModel); - GifLoaderDialogUtils.hideDialog( - context); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: AppText( - item.clinicName, - textAlign: TextAlign.left, - ), - value: item.clinicID, - ); - }).toList(), - )), - ], - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ), - ], - ), - isClinic: true, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 8), - ), - ]) - ])), - content: Column( - children: [ - model.dashboardItemsList.length > 0 - ? DashboardSwipeWidget( - model.dashboardItemsList, - model, - (sliderIndex) { - setState(() { - sliderActiveIndex = sliderIndex; - }); - }, - ) - : SizedBox(), - model.dashboardItemsList.length > 0 - ? FractionallySizedBox( - widthFactor: 0.90, - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - sliderActiveIndex == 1 - ? DashboardSliderItemWidget( - model.dashboardItemsList[4]) - : sliderActiveIndex == 0 - ? DashboardSliderItemWidget( - model.dashboardItemsList[3]) - : DashboardSliderItemWidget( - model.dashboardItemsList[6]), - ], - ), - ), - ) - : SizedBox(), - FractionallySizedBox( - // widthFactor: 0.90, + model.dashboardItemsList.length > 0 + ? DashboardSwipeWidget( + model.dashboardItemsList, + model, + (sliderIndex) { + setState(() { + sliderActiveIndex = sliderIndex; + }); + }, + ) + : SizedBox(), + model.dashboardItemsList.length > 0 + ? FractionallySizedBox( + widthFactor: 0.90, child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topRight: Radius.circular(50), - )), - padding: EdgeInsets.only(left: 20, top: 10, right: 20), - margin: EdgeInsets.only(top: 10), child: Column( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier *1,), - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patients, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 3, - fontWeight: FontWeight.bold, - fontHeight: .5, - ), - AppText( - TranslationBase.of(context).services, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 6, - fontWeight: FontWeight.bold, - ), - ], - )), - SizedBox( - height: SizeConfig.heightMultiplier *1, + height: SizeConfig.heightMultiplier * 5, ), - Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:11), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - ...homePatientsCardsWidget(model), - ],),), - SizedBox( - height: SizeConfig.heightMultiplier *1,), + sliderActiveIndex == 1 + ? DashboardSliderItemWidget( + model.dashboardItemsList[4]) + : sliderActiveIndex == 0 + ? DashboardSliderItemWidget( + model.dashboardItemsList[3]) + : DashboardSliderItemWidget( + model.dashboardItemsList[6]), ], ), ), - ), - ], + ) + : SizedBox(), + FractionallySizedBox( + // widthFactor: 0.90, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + )), + padding: EdgeInsets.only(left: 20, top: 10, right: 20), + margin: EdgeInsets.only(top: 10), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * 2, + ), + Container( + child: Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).services, + )), + SizedBox( + height: SizeConfig.heightMultiplier * 1, + ), + Container( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : 13), + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + ...homePatientsCardsWidget(model), + ], + ), + ), + SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?6:SizeConfig.isHeightShort?4:3)) + + ], + ), ), - ) + ), ]), ]), ), @@ -461,3 +307,6 @@ class _HomeScreenState extends State { } } } + + + diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart new file mode 100644 index 00000000..fe8cce38 --- /dev/null +++ b/lib/screens/home/home_screen_header.dart @@ -0,0 +1,205 @@ +// ignore: must_be_immutable +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { + + final DashboardViewModel model; + + double height = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 10 : 6); + + HomeScreenHeader({Key key, this.model}) : super(key: key); + + @override + _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); + + @override + // TODO: implement preferredSize + Size get preferredSize => Size(double.maxFinite,height); +} + +class _HomeScreenHeaderState extends State { + ProjectViewModel projectsProvider; + var clinicId; + + AuthenticationViewModel authenticationViewModel; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + authenticationViewModel = Provider.of(context); + + return Container( + color: Colors.grey[100], + child: Stack(children: [ + IconButton( + icon: Image.asset( + 'assets/images/menu.png', + width: SizeConfig.widthMultiplier * 7, + ), + iconSize: SizeConfig.heightMultiplier * 2, + color: Colors.black, + onPressed: () => Scaffold.of(context).openDrawer(), + ), + Column( + children: [ + ProfileWelcomeWidget( + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery + .of(context) + .size + .width * .6, + child: projectsProvider.doctorClinicsList.length > + 0 + ? Stack( + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[0].clinicID + : clinicId, + iconSize: SizeConfig.widthMultiplier * 7, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Container( + padding: + EdgeInsets.all(2), + margin: + EdgeInsets.all(2), + decoration: + new BoxDecoration( + color: + Colors.red[800], + borderRadius: + BorderRadius + .circular( + 20), + ), + constraints: + BoxConstraints( + minWidth: SizeConfig + .widthMultiplier * 5.5, + minHeight: SizeConfig + .widthMultiplier * 5, + ), + child: Center( + child: AppText( + projectsProvider + .doctorClinicsList + .length + .toString(), + color: + Colors.white, + fontSize: + projectsProvider + .isArabic + ? SizeConfig + .widthMultiplier * 3.5 + : SizeConfig + .widthMultiplier * 3, + textAlign: + TextAlign + .center, + ), + )), + ], + ), + AppText(item.clinicName, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth( + width: MediaQuery + .of(context) + .size + .width * .6) * 5, + color: Colors.black, + textOverflow: TextOverflow + .ellipsis, + fontWeight: + FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + setState(() { + clinicId = newValue; + }); + + GifLoaderDialogUtils.showMyDialog( + context); + await widget.model.changeClinic(newValue, + authenticationViewModel); + GifLoaderDialogUtils.hideDialog( + context); + if (widget.model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model.error); + } + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: AppText( + item.clinicName, + textAlign: TextAlign.left, + ), + value: item.clinicID, + ); + }).toList(), + )), + ], + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + ), + ], + ), + isClinic: true, + height: widget.height, + ), + ]) + ])); + } + + +} \ No newline at end of file diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 634abd02..58b6b77e 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,11 +1,8 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; -import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -270,4 +267,19 @@ class Helpers { var htmlRegex = RegExp("<(“[^”]*”|'[^’]*’|[^'”>])*>"); return htmlRegex.hasMatch(text); } + + static getNameFromKPI(String kpi) { + if (kpi.indexOf("(") > -1) + return kpi.substring(0, kpi.indexOf("(")); + else + return kpi; + } + + static getLabelFromKPI(String kpi) { + if (kpi.indexOf("(") > -1 && kpi.indexOf(")")>-1) + return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); + else + return ''; + + } } diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 193f572d..c1729b82 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -9,7 +9,7 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:12); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:13); return Container( width: width, padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 6ada94f1..cfa7ce68 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,5 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/screens/home/Label.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:flutter/material.dart'; @@ -21,20 +24,19 @@ class GetOutPatientStack extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( - child: AppText( - value.kPIName, - medium: true, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - ), + padding: EdgeInsets.symmetric(horizontal: 5,vertical: 5), + child: Label(firstLine:Helpers.getLabelFromKPI(value.kPIName) ,secondLine:Helpers.getNameFromKPI(value.kPIName),color: Color(0xFF2B353E), ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) ], ); } + + getStack(Summaryoptions value, max,context) { double barHeight = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 23 : 25); + (SizeConfig.isHeightVeryShort ? 23 : 19); return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), @@ -98,4 +100,5 @@ class GetOutPatientStack extends StatelessWidget { ), ); } + } diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index f34802a9..baf5713a 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -23,7 +23,7 @@ class BottomNavigationItem extends StatelessWidget { return Expanded( child: SizedBox( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 6), + (SizeConfig.isHeightVeryShort ? 10 :SizeConfig.isHeightShort ? 6: 7), child: Material( type: MaterialType.transparency, child: InkWell( @@ -49,11 +49,10 @@ class BottomNavigationItem extends StatelessWidget { Expanded( child: Text( name, - style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: currentIndex == index - ? Theme.of(context).primaryColor + ? Color(0xFF333C45) : Theme.of(context).dividerColor, ), ), From 3d5bb08adfd5144998d1083e38a01fd3dfdea700 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 3 Jun 2021 15:03:42 +0300 Subject: [PATCH 21/42] fix sms popup --- lib/config/size_config.dart | 10 +- lib/screens/home/Label.dart | 2 +- lib/widgets/auth/sms-popup.dart | 343 ++++++++++++++++---------------- 3 files changed, 180 insertions(+), 175 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 9179d99a..943bce75 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -19,6 +19,7 @@ class SizeConfig { static bool isMobile = false; static bool isHeightShort = false; static bool isHeightVeryShort = false; + static bool isWidthLarge = false; void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; @@ -32,20 +33,21 @@ class SizeConfig { } else if (constraints.maxHeight < 800) { isHeightShort = true; } + + if(constraints.maxWidth > 600) { + isWidthLarge = true; + } + if (orientation == Orientation.portrait) { isPortrait = true; if (realScreenWidth < 450) { isMobilePortrait = true; } - // textMultiplier = _blockHeight; - // imageSizeMultiplier = _blockWidth; screenHeight = realScreenHeight; screenWidth = realScreenWidth; } else { isPortrait = false; isMobilePortrait = false; - // textMultiplier = _blockWidth; - // imageSizeMultiplier = _blockHeight; screenHeight = realScreenWidth; screenWidth = realScreenHeight; } diff --git a/lib/screens/home/Label.dart b/lib/screens/home/Label.dart index 5d2338a5..73539b15 100644 --- a/lib/screens/home/Label.dart +++ b/lib/screens/home/Label.dart @@ -24,7 +24,7 @@ class Label extends StatelessWidget { children: [ AppText( firstLine, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3 , + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , // fontWeight: FontWeight.bold, color: color, fontHeight: .5, diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index e93489ef..42e4d263 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -47,6 +47,7 @@ class SMSOTP { bool isClosed = false; displayDialog(BuildContext context) async { double dialogWidth = MediaQuery.of(context).size.width * 0.90; + double dialogInputWidth = (dialogWidth / 4) - (SizeConfig.isWidthLarge?SizeConfig.getWidthMultiplier(width:dialogWidth )* 4.5: 20); double dialogHeight = SizeConfig.isHeightVeryShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40; return showDialog( context: context, @@ -56,222 +57,224 @@ class SMSOTP { width: dialogWidth, child: Material( child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: StatefulBuilder(builder: (context, setState) { - if (displayTime == '') { - startTimer(setState); - } + child: Center( + child: Container( + color: Colors.white, + child: StatefulBuilder(builder: (context, setState) { + if (displayTime == '') { + startTimer(setState); + } - return Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2,), + return Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2,), - Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - children: [ - Icon( - type == AuthMethodTypes.SMS - ? DoctorApp.verify_sms_1 - : DoctorApp.verify_whtsapp, - size: dialogWidth * 0.13, - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.close), - iconSize: dialogWidth * 0.13, - onPressed: () { - this.isClosed = true; - Navigator.pop(context); - this.onFailure(); - }, - ) - ], - ) - ]), - SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 10,), - Padding( - padding: EdgeInsets.only(top: 5, right: 5), - child: AppText( - TranslationBase.of(context).verificationMessage + - ' XXXXXX' + - mobileNo - .toString() - .substring(mobileNo.toString().length - 3), - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, //14, - maxLines: 2, - )), - Form( - key: verifyAccountForm, - child: Padding( - padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2), - child: Directionality( - textDirection: TextDirection.ltr, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, + Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + children: [ + Icon( + type == AuthMethodTypes.SMS + ? DoctorApp.verify_sms_1 + : DoctorApp.verify_whtsapp, + size: SizeConfig.getHeightMultiplier(height:dialogHeight) * 9, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - width: (dialogWidth / 4) - 20, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - child: TextFormField( - textInputAction: TextInputAction - .next, - style: buildTextStyle(), - autofocus: true, - maxLength: 1, - controller: digit1, - textAlign: TextAlign.center, - keyboardType: TextInputType.number, - decoration: buildInputDecoration( - context), - onSaved: (val) {}, - validator: validateCodeDigit, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD2); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); - checkValue(); - } - }, - ), - ), - Container( - width: dialogWidth / 4 - 20, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - child: TextFormField( - focusNode: focusD2, + IconButton( + icon: Icon(Icons.close), + iconSize: SizeConfig.getHeightMultiplier(height:dialogHeight) * 15, + onPressed: () { + this.isClosed = true; + Navigator.pop(context); + this.onFailure(); + }, + ) + ], + ) + ]), + SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * (SizeConfig.isHeightVeryShort?10:5),), + Padding( + padding: EdgeInsets.only(top: 5, right: 5), + child: AppText( + TranslationBase.of(context).verificationMessage + + ' XXXXXX' + + mobileNo + .toString() + .substring(mobileNo.toString().length - 3), + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, //14, + maxLines: 2, + )), + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: dialogInputWidth, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + child: TextFormField( textInputAction: TextInputAction .next, + style: buildTextStyle(), + autofocus: true, maxLength: 1, - controller: digit2, + controller: digit1, textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType - .number, + keyboardType: TextInputType.number, decoration: buildInputDecoration( context), onSaved: (val) {}, + validator: validateCodeDigit, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD3); + .requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit), - ), - Container( - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - width: dialogWidth / 4 - 20, + ), + ), + Container( + width: dialogInputWidth, height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), child: TextFormField( - focusNode: focusD3, + focusNode: focusD2, textInputAction: TextInputAction .next, maxLength: 1, - controller: digit3, + controller: digit2, textAlign: TextAlign.center, style: buildTextStyle(), keyboardType: TextInputType .number, - decoration: - buildInputDecoration(context), + decoration: buildInputDecoration( + context), onSaved: (val) {}, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD4); + .requestFocus(focusD3); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit)), - Container( - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - width: dialogWidth / 4 - 20, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + validator: validateCodeDigit), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + width: dialogInputWidth, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction + .next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + Container( + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + width: dialogInputWidth, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - child: TextFormField( - focusNode: focusD4, - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - controller: digit4, - keyboardType: TextInputType - .number, - decoration: - buildInputDecoration(context), - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - ], - )), + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue['digit4'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + ], + )), + ), ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).validationMessage + - ' ', - fontWeight: FontWeight.w600, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, - ), - AppText( - displayTime, - color: Colors.red, - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, - ) - ]) - ], + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).validationMessage + + ' ', + fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, + ), + AppText( + displayTime, + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, + ) + ]) + ], + ), ), - ), - ); + ); - }) + }) + ), ), ), ), From 259ea53319c8fb3125a1036d7b417eac72f55c5c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 3 Jun 2021 22:19:28 +0300 Subject: [PATCH 22/42] home design --- .../home/dashboard_referral_patient.dart | 37 ++++++++++++++++--- .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/home_screen.dart | 8 +++- lib/screens/home/home_screen_header.dart | 18 +++++---- lib/screens/home/{Label.dart => label.dart} | 7 ++-- lib/widgets/dashboard/out_patient_stack.dart | 31 ++++++++++------ lib/widgets/shared/app_scaffold_widget.dart | 4 +- 7 files changed, 78 insertions(+), 29 deletions(-) rename lib/screens/home/{Label.dart => label.dart} (74%) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 7be28985..f7bb9ad5 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -10,8 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; -import 'Label.dart'; - +import 'label.dart'; class DashboardReferralPatient extends StatelessWidget { final List dashboardItemList; @@ -58,12 +57,40 @@ class DashboardReferralPatient extends StatelessWidget { CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?2: 2) + height: SizeConfig + .getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 3 + : SizeConfig.isHeightShort + ? 2 + : 2) ), - Label(firstLine:TranslationBase.of(context).patients ,secondLine:TranslationBase.of(context).referral,color: Color(0xFF2B353E), ), + Label(firstLine: TranslationBase + .of(context) + .patients, + secondLine: TranslationBase + .of(context) + .referral, + color: Color(0xFF2B353E), + fontSize: SizeConfig + .getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 7 + : 12),), SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?5:SizeConfig.isHeightShort?10: 12) + height: SizeConfig + .getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 10 + : 12) ) ], ),), diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 3ffb5ae5..8877aa29 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_card.dart'; import 'package:flutter/material.dart'; -import 'Label.dart'; +import 'label.dart'; class DashboardSliderItemWidget extends StatelessWidget { final DashboardModel item; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 603c20cd..684cf95a 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -23,8 +23,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'Label.dart'; import 'home_screen_header.dart'; +import 'label.dart'; class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -46,6 +46,8 @@ class _HomeScreenState extends State { String clinicId; AuthenticationViewModel authenticationViewModel; int colorIndex = 0; + final GlobalKey scaffoldKey = new GlobalKey(); + @override Widget build(BuildContext context) { @@ -58,6 +60,7 @@ class _HomeScreenState extends State { } return BaseView( + onModelReady: (model) async { await model.setFirebaseNotification( projectsProvider, authenticationViewModel); @@ -70,6 +73,9 @@ class _HomeScreenState extends State { isShowAppBar: true, appBar: HomeScreenHeader( model: model, + onOpenDrawer: (){ + Scaffold.of(context).openDrawer(); + }, ), body: ListView(children: [ Column(children: [ diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index fe8cce38..7d38e898 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -17,11 +17,12 @@ import 'package:provider/provider.dart'; class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { final DashboardViewModel model; + final Function onOpenDrawer; double height = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6); - HomeScreenHeader({Key key, this.model}) : super(key: key); + HomeScreenHeader({Key key, this.model, this.onOpenDrawer}) : super(key: key); @override _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); @@ -33,7 +34,8 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { class _HomeScreenHeaderState extends State { ProjectViewModel projectsProvider; - var clinicId; + int clinicId; + AuthenticationViewModel authenticationViewModel; @@ -53,7 +55,9 @@ class _HomeScreenHeaderState extends State { ), iconSize: SizeConfig.heightMultiplier * 2, color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), + onPressed: (){ + widget.onOpenDrawer(); + }, ), Column( children: [ @@ -113,9 +117,9 @@ class _HomeScreenHeaderState extends State { constraints: BoxConstraints( minWidth: SizeConfig - .widthMultiplier * 5.5, + .getHeightMultiplier(height: widget.height) * 50, minHeight: SizeConfig - .widthMultiplier * 5, + .getHeightMultiplier(height: widget.height) * 50, ), child: Center( child: AppText( @@ -129,9 +133,9 @@ class _HomeScreenHeaderState extends State { projectsProvider .isArabic ? SizeConfig - .widthMultiplier * 3.5 + .getHeightMultiplier(height: widget.height) : SizeConfig - .widthMultiplier * 3, + .getHeightMultiplier(height: widget.height) * 30, textAlign: TextAlign .center, diff --git a/lib/screens/home/Label.dart b/lib/screens/home/label.dart similarity index 74% rename from lib/screens/home/Label.dart rename to lib/screens/home/label.dart index 73539b15..bf80dca8 100644 --- a/lib/screens/home/Label.dart +++ b/lib/screens/home/label.dart @@ -7,11 +7,12 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color, + Key key, this.firstLine, this.secondLine, this.color, this.fontSize, }) : super(key: key); final String firstLine; final String secondLine; Color color; + final double fontSize; @override Widget build(BuildContext context) { @@ -24,7 +25,7 @@ class Label extends StatelessWidget { children: [ AppText( firstLine, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , // fontWeight: FontWeight.bold, color: color, fontHeight: .5, @@ -32,7 +33,7 @@ class Label extends StatelessWidget { AppText( secondLine, color: color, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?6:6.40), fontWeight: FontWeight.bold, ), ], diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index cfa7ce68..a609986e 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,8 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/screens/home/Label.dart'; +import 'package:doctor_app_flutter/screens/home/label.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:flutter/material.dart'; @@ -13,30 +12,40 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { + double barHeight = + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 23 : 19); value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); var list = new List(); - value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value,context))}); + value.summaryoptions.forEach((result) => { + list.add(getStack( + result, value.summaryoptions.first.value, context, barHeight)) + }); return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( - padding: EdgeInsets.symmetric(horizontal: 5,vertical: 5), - child: Label(firstLine:Helpers.getLabelFromKPI(value.kPIName) ,secondLine:Helpers.getNameFromKPI(value.kPIName),color: Color(0xFF2B353E), ), + padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), + child: Label( + firstLine: Helpers.getLabelFromKPI(value.kPIName), + secondLine: Helpers.getNameFromKPI(value.kPIName), + color: Color(0xFF2B353E), + fontSize: SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 9 + : 12), + ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) ], ); } - - - getStack(Summaryoptions value, max,context) { - double barHeight = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 23 : 19); + getStack(Summaryoptions value, max, context, barHeight) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e957b5d4..d3533801 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -21,6 +21,7 @@ class AppScaffold extends StatelessWidget { final Widget appBar; final String subtitle; final bool isHomeIcon; + final Key key; AppScaffold( {this.appBarTitle = '', this.body, @@ -30,7 +31,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle}); + this.appBar, this.subtitle, this.key}); @override Widget build(BuildContext context) { @@ -42,6 +43,7 @@ class AppScaffold extends StatelessWidget { }, child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, + key: key, appBar: isShowAppBar ? appBar ?? AppBar( From d0173bd061fe37d82d31ba8d902a26bf5ced25c2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 11:32:41 +0300 Subject: [PATCH 23/42] home design fixes --- .../home/dashboard_referral_patient.dart | 4 +- lib/screens/home/home_screen.dart | 10 ++--- lib/screens/home/home_screen_header.dart | 43 +++++++++++-------- lib/screens/home/label.dart | 10 +++-- lib/widgets/dashboard/out_patient_stack.dart | 18 +++++--- .../shared/bottom_navigation_item.dart | 10 ++--- 6 files changed, 57 insertions(+), 38 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index f7bb9ad5..1a9c09a2 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -73,7 +73,7 @@ class DashboardReferralPatient extends StatelessWidget { .of(context) .referral, color: Color(0xFF2B353E), - fontSize: SizeConfig + secondLineFontSize: SizeConfig .getHeightMultiplier( height: height) * (SizeConfig.isHeightVeryShort @@ -90,7 +90,7 @@ class DashboardReferralPatient extends StatelessWidget { ? 5 : SizeConfig.isHeightShort ? 10 - : 12) + : 5) ) ], ),), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 684cf95a..a0ef6310 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -71,7 +71,7 @@ class _HomeScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: HomeScreenHeader( + appBar: HomeScreenHeader( model: model, onOpenDrawer: (){ Scaffold.of(context).openDrawer(); @@ -98,7 +98,7 @@ class _HomeScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * 5, + height: SizeConfig.heightMultiplier * 3, ), sliderActiveIndex == 1 ? DashboardSliderItemWidget( @@ -128,7 +128,7 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * 2, + height: SizeConfig.heightMultiplier * 1, ), Container( child: Label( @@ -136,7 +136,7 @@ class _HomeScreenState extends State { secondLine: TranslationBase.of(context).services, )), SizedBox( - height: SizeConfig.heightMultiplier * 1, + height: SizeConfig.heightMultiplier * .6, ), Container( height: SizeConfig.heightMultiplier * @@ -152,7 +152,7 @@ class _HomeScreenState extends State { ], ), ), - SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?6:SizeConfig.isHeightShort?4:3)) + SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?6:SizeConfig.isHeightShort?4:2)) ], ), diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 7d38e898..1e0536e1 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -45,18 +45,20 @@ class _HomeScreenHeaderState extends State { ProjectViewModel projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); - return Container( - color: Colors.grey[100], - child: Stack(children: [ - IconButton( - icon: Image.asset( - 'assets/images/menu.png', - width: SizeConfig.widthMultiplier * 7, - ), - iconSize: SizeConfig.heightMultiplier * 2, - color: Colors.black, - onPressed: (){ - widget.onOpenDrawer(); + return widget.model.state == ViewState.Busy + ? Container(color: Colors.grey.withOpacity(0.6)) + : Container( + color: Colors.grey[100], + child: Stack(children: [ + IconButton( + icon: Image.asset( + 'assets/images/menu.png', + width: SizeConfig.widthMultiplier * 7, + ), + iconSize: SizeConfig.heightMultiplier * 2, + color: Colors.black, + onPressed: () { + widget.onOpenDrawer(); }, ), Column( @@ -117,9 +119,13 @@ class _HomeScreenHeaderState extends State { constraints: BoxConstraints( minWidth: SizeConfig - .getHeightMultiplier(height: widget.height) * 50, + .getHeightMultiplier( + height: widget.height) * + 35, minHeight: SizeConfig - .getHeightMultiplier(height: widget.height) * 50, + .getHeightMultiplier( + height: widget.height) * + 30, ), child: Center( child: AppText( @@ -133,9 +139,12 @@ class _HomeScreenHeaderState extends State { projectsProvider .isArabic ? SizeConfig - .getHeightMultiplier(height: widget.height) + .getHeightMultiplier( + height: widget.height) : SizeConfig - .getHeightMultiplier(height: widget.height) * 30, + .getHeightMultiplier( + height: widget + .height) * 20, textAlign: TextAlign .center, @@ -150,7 +159,7 @@ class _HomeScreenHeaderState extends State { .of(context) .size .width * .6) * 5, - color: Colors.black, + color: Color(0xFF2B353E), textOverflow: TextOverflow .ellipsis, fontWeight: diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index bf80dca8..d732d1c9 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -7,12 +7,13 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color, this.fontSize, + Key key, this.firstLine, this.secondLine, this.color, this.secondLineFontSize, this.firstLineFontSize, }) : super(key: key); final String firstLine; final String secondLine; Color color; - final double fontSize; + final double secondLineFontSize; + final double firstLineFontSize; @override Widget build(BuildContext context) { @@ -25,15 +26,16 @@ class Label extends StatelessWidget { children: [ AppText( firstLine, - fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , // fontWeight: FontWeight.bold, color: color, fontHeight: .5, + fontWeight: FontWeight.w600, ), AppText( secondLine, color: color, - fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?6:6.40), + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), fontWeight: FontWeight.bold, ), ], diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index a609986e..387c2625 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -13,7 +13,7 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { double barHeight = - SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 23 : 19); + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 17); value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); @@ -32,12 +32,20 @@ class GetOutPatientStack extends StatelessWidget { firstLine: Helpers.getLabelFromKPI(value.kPIName), secondLine: Helpers.getNameFromKPI(value.kPIName), color: Color(0xFF2B353E), - fontSize: SizeConfig.getHeightMultiplier(height: barHeight) * + firstLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * (SizeConfig.isHeightVeryShort - ? 5 + ? 10 : SizeConfig.isHeightShort - ? 9 - : 12), + ? 10 + : 8.5), + secondLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 15 + : SizeConfig.isHeightShort + ? 15 + : 14.5), ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index baf5713a..eb87f50f 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -23,7 +23,7 @@ class BottomNavigationItem extends StatelessWidget { return Expanded( child: SizedBox( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 :SizeConfig.isHeightShort ? 6: 7), + (SizeConfig.isHeightVeryShort ? 10 :SizeConfig.isHeightShort ? 8: 8), child: Material( type: MaterialType.transparency, child: InkWell( @@ -35,14 +35,14 @@ class BottomNavigationItem extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 9) ) * 10,), + (SizeConfig.isHeightVeryShort ? 12:SizeConfig.isHeightShort ?10 : 9) ) * 10,), Container( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? Color(0xFF333C45) - : Theme.of(context).dividerColor, + : Color(0xFF989898), size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 40,), + (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40,), ), SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 0.5,), @@ -53,7 +53,7 @@ class BottomNavigationItem extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: currentIndex == index ? Color(0xFF333C45) - : Theme.of(context).dividerColor, + : Color(0xFF989898)//#989898, ), ), ), From c671b60097a3f2aae5c848460928314030b9b257 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 12:14:18 +0300 Subject: [PATCH 24/42] home design fixes --- lib/screens/home/home_screen.dart | 3 ++- lib/screens/home/home_screen_header.dart | 2 +- lib/screens/home/label.dart | 6 ++---- lib/widgets/dashboard/activity_card.dart | 2 +- lib/widgets/shared/bottom_navigation_item.dart | 4 +++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index a0ef6310..2bc42f5e 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -113,6 +113,7 @@ class _HomeScreenState extends State { ), ) : SizedBox(), + FractionallySizedBox( // widthFactor: 0.90, child: Container( @@ -177,7 +178,7 @@ class _HomeScreenState extends State { backgroundIconColors[2] = Colors.white10; List textColors = List(3); textColors[0] = Colors.white; - textColors[1] = Colors.black; + textColors[1] = Color(0xFF353E47); textColors[2] = Colors.white; List patientCards = List(); diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 1e0536e1..8e30504c 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -46,7 +46,7 @@ class _HomeScreenHeaderState extends State { authenticationViewModel = Provider.of(context); return widget.model.state == ViewState.Busy - ? Container(color: Colors.grey.withOpacity(0.6)) + ? Container(color: Colors.grey.withOpacity(0.65)) : Container( color: Colors.grey[100], child: Stack(children: [ diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index d732d1c9..221215c0 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color, this.secondLineFontSize, this.firstLineFontSize, + Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, }) : super(key: key); final String firstLine; final String secondLine; @@ -17,9 +17,7 @@ class Label extends StatelessWidget { @override Widget build(BuildContext context) { - if(color == null) { - color = Color(0xFF2E303A); - } + return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index c1729b82..44f0c50c 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -34,7 +34,7 @@ class GetActivityCard extends StatelessWidget { AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 8), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index eb87f50f..aa986a39 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -37,6 +37,7 @@ class BottomNavigationItem extends StatelessWidget { SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 12:SizeConfig.isHeightShort ?10 : 9) ) * 10,), Container( + margin: EdgeInsets.only(bottom: 3), child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? Color(0xFF333C45) @@ -49,8 +50,9 @@ class BottomNavigationItem extends StatelessWidget { Expanded( child: Text( name, + textAlign: TextAlign.center, style: TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2, color: currentIndex == index ? Color(0xFF333C45) : Color(0xFF989898)//#989898, From 60b5d474c1d8efe2f87a3ecb3d8f07c1420b714e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 16:13:12 +0300 Subject: [PATCH 25/42] home design fixes for small and large screen --- lib/screens/home/dashboard_referral_patient.dart | 2 +- lib/screens/home/dashboard_swipe_widget.dart | 4 ++-- lib/screens/home/home_patient_card.dart | 7 ++++--- lib/screens/home/home_screen.dart | 15 ++++++++++++--- lib/screens/home/home_screen_header.dart | 14 ++++++-------- lib/widgets/dashboard/activity_card.dart | 2 +- .../dashboard/swiper_rounded_pagination.dart | 10 +++++----- .../patients/profile/profile-welcome-widget.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 10 +++++----- lib/widgets/shared/app_scaffold_widget.dart | 4 +--- lib/widgets/shared/drawer_item_widget.dart | 8 ++++---- 11 files changed, 42 insertions(+), 36 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 1a9c09a2..0b9e6765 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -22,7 +22,7 @@ class DashboardReferralPatient extends StatelessWidget { Widget build(BuildContext context) { return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.2, shadowSpreadRadius: 3, diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 1b5ce330..68e1263b 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -86,7 +86,7 @@ class _DashboardSwipeWidgetState extends State { if (index == 1) return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.2, shadowSpreadRadius: 3, @@ -102,7 +102,7 @@ class _DashboardSwipeWidgetState extends State { if (index == 0) return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.2, shadowSpreadRadius: 3, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 0a24b4db..3a7ded81 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,11 +22,12 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightVeryShort?14:13); + double width = SizeConfig.heightMultiplier* + (SizeConfig.isHeightVeryShort ? 16 : 13); return HomePageCard( color: backgroundColor, width: width, - margin: EdgeInsets.all(4), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.6), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -72,7 +73,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort?10:12), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort?11:12), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2bc42f5e..75e02aa4 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -79,6 +79,9 @@ class _HomeScreenState extends State { ), body: ListView(children: [ Column(children: [ + // SizedBox( + // height: SizeConfig.heightMultiplier * 1.4, + // ), model.dashboardItemsList.length > 0 ? DashboardSwipeWidget( model.dashboardItemsList, @@ -90,6 +93,10 @@ class _HomeScreenState extends State { }, ) : SizedBox(), + + // SizedBox( + // height: SizeConfig.heightMultiplier * 1.4, + // ), model.dashboardItemsList.length > 0 ? FractionallySizedBox( widthFactor: 0.90, @@ -113,14 +120,16 @@ class _HomeScreenState extends State { ), ) : SizedBox(), - + SizedBox( + height: SizeConfig.heightMultiplier * 1.4, + ), FractionallySizedBox( // widthFactor: 0.90, child: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( - topRight: Radius.circular(50), + topRight: Radius.circular(70), )), padding: EdgeInsets.only(left: 20, top: 10, right: 20), margin: EdgeInsets.only(top: 10), @@ -153,7 +162,7 @@ class _HomeScreenState extends State { ], ), ), - SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?6:SizeConfig.isHeightShort?4:2)) + SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?4:2)) ], ), diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 8e30504c..263d332f 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -28,7 +29,6 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); @override - // TODO: implement preferredSize Size get preferredSize => Size(double.maxFinite,height); } @@ -51,11 +51,8 @@ class _HomeScreenHeaderState extends State { color: Colors.grey[100], child: Stack(children: [ IconButton( - icon: Image.asset( - 'assets/images/menu.png', - width: SizeConfig.widthMultiplier * 7, - ), - iconSize: SizeConfig.heightMultiplier * 2, + icon: Icon(FontAwesomeIcons.ellipsisH), + iconSize: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?4: 3), color: Colors.black, onPressed: () { widget.onOpenDrawer(); @@ -65,7 +62,7 @@ class _HomeScreenHeaderState extends State { children: [ ProfileWelcomeWidget( Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, children: [ Container( width: MediaQuery @@ -101,6 +98,7 @@ class _HomeScreenHeaderState extends State { mainAxisAlignment: MainAxisAlignment .center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( padding: @@ -158,7 +156,7 @@ class _HomeScreenHeaderState extends State { width: MediaQuery .of(context) .size - .width * .6) * 5, + .width * .6) * (SizeConfig.isWidthLarge?4:5), color: Color(0xFF2B353E), textOverflow: TextOverflow .ellipsis, diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 44f0c50c..71fcad7f 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -13,7 +13,7 @@ class GetActivityCard extends StatelessWidget { return Container( width: width, padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), - margin: EdgeInsets.all(SizeConfig.heightMultiplier * .5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), diff --git a/lib/widgets/dashboard/swiper_rounded_pagination.dart b/lib/widgets/dashboard/swiper_rounded_pagination.dart index 7e5c2c70..c0360d96 100644 --- a/lib/widgets/dashboard/swiper_rounded_pagination.dart +++ b/lib/widgets/dashboard/swiper_rounded_pagination.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; class SwiperRoundedPagination extends StatelessWidget { @@ -7,15 +8,14 @@ class SwiperRoundedPagination extends StatelessWidget { Widget build(BuildContext context) { return active == true ? Container( - height: 5, - width: 30, - // margin: EdgeInsets.only(10), + height: SizeConfig.heightMultiplier * .6, + width: SizeConfig.widthMultiplier * 6, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), color: Colors.black), ) : Container( - height: 5, - width: 8, + height: SizeConfig.heightMultiplier * .6, + width: SizeConfig.widthMultiplier * 2, margin: EdgeInsets.all(2), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.grey)); diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index a7621115..17b88630 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -22,7 +22,7 @@ class ProfileWelcomeWidget extends StatelessWidget { widthFactor: 0.9, child: Row( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ this.isClinic == true ? clinicWidget : SizedBox(), SizedBox( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index ee74590f..800bbc19 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -50,7 +50,7 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightVeryShort? 25:SizeConfig.isHeightVeryShort?30: 32), + width: drawerWidth) * (SizeConfig.isHeightVeryShort? 25:SizeConfig.isHeightShort?32: 32), ), margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), @@ -97,7 +97,7 @@ class _AppDrawerState extends State { fontFamily: 'Poppins', fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 8, + width: drawerWidth) * (SizeConfig.isWidthLarge?5: 8), ), ), Padding( @@ -109,7 +109,7 @@ class _AppDrawerState extends State { color: Color(0xFF2E303A), fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 6, + width: drawerWidth) * (SizeConfig.isWidthLarge?3: 6), fontFamily: 'Poppins', )) ], @@ -232,7 +232,7 @@ class _AppDrawerState extends State { fontWeight: FontWeight.bold, fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 6, + width: drawerWidth) * (SizeConfig.isWidthLarge?4: 6), fontFamily: 'Poppins', ), children: [ @@ -242,7 +242,7 @@ class _AppDrawerState extends State { color: Color(0xFF2E303A), fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 7, + width: drawerWidth) * (SizeConfig.isWidthLarge?5: 7), fontFamily: 'Poppins', ), ) diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index d3533801..e957b5d4 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -21,7 +21,6 @@ class AppScaffold extends StatelessWidget { final Widget appBar; final String subtitle; final bool isHomeIcon; - final Key key; AppScaffold( {this.appBarTitle = '', this.body, @@ -31,7 +30,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle, this.key}); + this.appBar, this.subtitle}); @override Widget build(BuildContext context) { @@ -43,7 +42,6 @@ class AppScaffold extends StatelessWidget { }, child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, - key: key, appBar: isShowAppBar ? appBar ?? AppBar( diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 71021f5d..6d381cad 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -29,15 +29,15 @@ class _DrawerItemState extends State { children: [ if(widget.assetLink!=null) Container( - height: 20, - width: 20, + height: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), + width: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), child: Image.asset(widget.assetLink), ), if(widget.assetLink==null) Icon( widget.icon, color: widget.color ?? Colors.black87, - size: SizeConfig.imageSizeMultiplier * 5, + size: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), ), Expanded( child: Column( @@ -51,7 +51,7 @@ class _DrawerItemState extends State { marginLeft: 5, marginRight: 5, color:widget.color ??Color(0xFF2E303A), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * (SizeConfig.isHeightVeryShort?5:6), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * (SizeConfig.isHeightVeryShort?5:(SizeConfig.isWidthLarge?4: 6)), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), From 1f8a90e47b85f03bbedc91ca7eac3f22880cf641 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 17:15:52 +0300 Subject: [PATCH 26/42] add letterspaceing --- lib/screens/home/home_patient_card.dart | 2 +- lib/screens/home/home_screen.dart | 4 ++-- lib/screens/home/home_screen_header.dart | 3 +++ lib/screens/home/label.dart | 3 +++ lib/widgets/dashboard/activity_card.dart | 2 ++ lib/widgets/dashboard/out_patient_stack.dart | 8 ++++--- .../profile/profile-welcome-widget.dart | 3 --- lib/widgets/shared/app_texts_widget.dart | 21 ++++++++++--------- 8 files changed, 27 insertions(+), 19 deletions(-) diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 3a7ded81..16877677 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -27,7 +27,7 @@ class HomePatientCard extends StatelessWidget { return HomePageCard( color: backgroundColor, width: width, - margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.6), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), child: Container( padding: EdgeInsets.all(8), child: Column( diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 75e02aa4..9b50e8c7 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -99,7 +99,7 @@ class _HomeScreenState extends State { // ), model.dashboardItemsList.length > 0 ? FractionallySizedBox( - widthFactor: 0.90, + widthFactor: 0.94, child: Container( child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -131,7 +131,7 @@ class _HomeScreenState extends State { borderRadius: BorderRadius.only( topRight: Radius.circular(70), )), - padding: EdgeInsets.only(left: 20, top: 10, right: 20), + padding: EdgeInsets.only(left: 10, top: 10, right: 10), margin: EdgeInsets.only(top: 10), child: Column( mainAxisAlignment: MainAxisAlignment.start, diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 263d332f..7284b659 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -158,6 +158,9 @@ class _HomeScreenHeaderState extends State { .size .width * .6) * (SizeConfig.isWidthLarge?4:5), color: Color(0xFF2B353E), + maxLines: 1, + maxLength: 2, + letterSpacing: -0.96, textOverflow: TextOverflow .ellipsis, fontWeight: diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index 221215c0..7e853323 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -28,6 +28,7 @@ class Label extends StatelessWidget { // fontWeight: FontWeight.bold, color: color, fontHeight: .5, + letterSpacing: -0.72, fontWeight: FontWeight.w600, ), AppText( @@ -35,6 +36,8 @@ class Label extends StatelessWidget { color: color, fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), fontWeight: FontWeight.bold, + letterSpacing: -1.44, + ), ], ); diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 71fcad7f..22d08932 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -30,6 +30,7 @@ class GetActivityCard extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), + letterSpacing: -0.93, ), AppText( value.kPIParameter, @@ -38,6 +39,7 @@ class GetActivityCard extends StatelessWidget { color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, + letterSpacing: -0.33, ), ], ), diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 387c2625..0405b5b7 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -65,7 +65,7 @@ class GetOutPatientStack extends StatelessWidget { colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(4), // color: Colors.red[50], ), child: Stack(children: [ @@ -78,7 +78,7 @@ class GetOutPatientStack extends StatelessWidget { padding: EdgeInsets.all(10), height: max != 0 ? ((barHeight )* value.value) / max : 0, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(4), color: Color(0x63D02127), ), ), @@ -99,13 +99,15 @@ class GetOutPatientStack extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, + letterSpacing: -0.3, ), AppText( ' (' + value.value.toString() + ') ', fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), + letterSpacing: -0.3, fontWeight: FontWeight.bold, ), ], diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 17b88630..cd712a07 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -25,9 +25,6 @@ class ProfileWelcomeWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ this.isClinic == true ? clinicWidget : SizedBox(), - SizedBox( - width: 20, - ), if(authenticationViewModel.doctorProfile!=null) CircleAvatar( // radius: (52) diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 48661a32..3f07cc80 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -18,6 +18,7 @@ class AppText extends StatefulWidget { final double marginRight; final double marginBottom; final double marginLeft; + final double letterSpacing; final TextAlign textAlign; final bool bold; final bool regular; @@ -56,6 +57,7 @@ class AppText extends StatefulWidget { this.visibility = true, this.textOverflow, this.textDecoration, + this.letterSpacing, }); @override @@ -127,16 +129,15 @@ class _AppTextState extends State { fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, - color: - widget.color != null ? widget.color : Colors.black, - fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: - widget.variant == "overline" ? 1.5 : null, - fontWeight: widget.fontWeight ?? _getFontWeight(), - fontFamily: widget.fontFamily ?? 'Poppins', - decoration: widget.textDecoration, - height: widget.fontHeight), + fontStyle: widget.italic ? FontStyle.italic : null, + color: + widget.color != null ? widget.color : Colors.black, + fontSize: widget.fontSize ?? _getFontSize(), + letterSpacing: widget.letterSpacing, + fontWeight: widget.fontWeight ?? _getFontWeight(), + fontFamily: widget.fontFamily ?? 'Poppins', + decoration: widget.textDecoration, + height: widget.fontHeight), ), if (widget.readMore && text.length > widget.maxLength && hidden) Positioned( From 39887f3eadfe76e2ffa895b7d6825a76d6a6bcea Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 12:25:24 +0300 Subject: [PATCH 27/42] fix issue on design --- lib/config/size_config.dart | 6 ++++++ lib/screens/home/home_patient_card.dart | 14 +++++++++----- lib/screens/home/home_screen.dart | 2 +- lib/widgets/auth/method_type_card.dart | 8 ++++---- lib/widgets/auth/sms-popup.dart | 16 ++++++++++++++-- lib/widgets/dashboard/out_patient_stack.dart | 2 +- 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 943bce75..55cc6128 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -19,6 +19,8 @@ class SizeConfig { 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) { @@ -32,6 +34,10 @@ class SizeConfig { isHeightVeryShort = true; } else if (constraints.maxHeight < 800) { isHeightShort = true; + } else if (constraints.maxHeight < 1400) { + isHeightMiddle = true; + } else { + isHeightLarge = true; } if(constraints.maxWidth > 600) { diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 16877677..df1784c1 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -38,13 +38,14 @@ class HomePatientCard extends StatelessWidget { child: Stack( children: [ Positioned( - bottom: 0.02, - right: 0.2, + top: SizeConfig.isHeightVeryShort ? 8 : 8, + left: SizeConfig.isHeightVeryShort ? 5 : 10, width: SizeConfig.getWidthMultiplier(width: width) * 10, height: SizeConfig.getWidthMultiplier(width: width) * 15, child: Icon( cardIcon, - size: SizeConfig.getWidthMultiplier(width: width) * 40, + size: SizeConfig.getWidthMultiplier(width: width) * + (SizeConfig.isHeightVeryShort ? 45 : 60), color: backgroundIconColor, ), ), @@ -55,7 +56,8 @@ class HomePatientCard extends StatelessWidget { children: [ Icon( cardIcon, - size: SizeConfig.getWidthMultiplier(width: width) * 20, + size: + SizeConfig.getWidthMultiplier(width: width) * 22, color: textColor, ), SizedBox( @@ -73,7 +75,9 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort?11:12), + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth(width: width) * + (SizeConfig.isHeightVeryShort ? 11 : 10), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 9b50e8c7..a33009af 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -131,7 +131,7 @@ class _HomeScreenState extends State { borderRadius: BorderRadius.only( topRight: Radius.circular(70), )), - padding: EdgeInsets.only(left: 10, top: 10, right: 10), + padding: EdgeInsets.only(left: SizeConfig.widthMultiplier * 3.1, top: 10, right: SizeConfig.widthMultiplier * 3.1), margin: EdgeInsets.only(top: 10), child: Column( mainAxisAlignment: MainAxisAlignment.start, diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index db3a724b..2d2f81e8 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -17,7 +17,7 @@ class MethodTypeCard extends StatelessWidget { @override Widget build(BuildContext context) { - double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : 15); + double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : 20); return InkWell( onTap: onTap, child: Container( @@ -39,7 +39,7 @@ class MethodTypeCard extends StatelessWidget { children: [ Image.asset( assetPath, - width: SizeConfig.widthMultiplier* 12, + width: SizeConfig.widthMultiplier* (12), height: cardHeight * 0.35, // height: , ), @@ -48,9 +48,9 @@ class MethodTypeCard extends StatelessWidget { ), AppText( label, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w700, ) ], ), diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 42e4d263..fbe6492b 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -51,11 +51,15 @@ class SMSOTP { double dialogHeight = SizeConfig.isHeightVeryShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40; return showDialog( context: context, + + builder: (ctx) => Center( child: Container( + color: Colors.white, height: dialogHeight, width: dialogWidth, child: Material( + color: Colors.white, child: SingleChildScrollView( child: Center( child: Container( @@ -82,12 +86,14 @@ class SMSOTP { ? DoctorApp.verify_sms_1 : DoctorApp.verify_whtsapp, size: SizeConfig.getHeightMultiplier(height:dialogHeight) * 9, + color: Color(0xFF2B353E), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ IconButton( icon: Icon(Icons.close), + color: Color(0xFF2B353E), iconSize: SizeConfig.getHeightMultiplier(height:dialogHeight) * 15, onPressed: () { this.isClosed = true; @@ -108,7 +114,9 @@ class SMSOTP { .toString() .substring(mobileNo.toString().length - 3), textAlign: TextAlign.start, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + color: Color(0xFF2B353E), fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, //14, maxLines: 2, )), @@ -255,7 +263,11 @@ class SMSOTP { AppText( TranslationBase.of(context).validationMessage + ' ', - fontWeight: FontWeight.w600, + + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + color: Color(0xFF2B353E), fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, ), AppText( diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 0405b5b7..d83e4cd6 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -99,7 +99,7 @@ class GetOutPatientStack extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, letterSpacing: -0.3, ), AppText( From ecb600c4fc0075b8f4e137d15f73aa14f7e846a2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 17:49:46 +0300 Subject: [PATCH 28/42] small fixes --- lib/config/config.dart | 4 ++-- lib/config/size_config.dart | 2 +- lib/screens/auth/verification_methods_screen.dart | 3 +-- lib/screens/home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/dashboard_swipe_widget.dart | 2 +- lib/screens/home/home_patient_card.dart | 2 +- lib/screens/home/home_screen.dart | 4 +--- lib/widgets/auth/method_type_card.dart | 2 +- lib/widgets/dashboard/activity_card.dart | 2 +- lib/widgets/dashboard/out_patient_stack.dart | 2 +- pubspec.lock | 6 +++--- 11 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 588976ba..d3d8f831 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 55cc6128..e37e39ac 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -34,7 +34,7 @@ class SizeConfig { isHeightVeryShort = true; } else if (constraints.maxHeight < 800) { isHeightShort = true; - } else if (constraints.maxHeight < 1400) { + } else if (constraints.maxHeight < 1000) { isHeightMiddle = true; } else { isHeightLarge = true; diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 54bf26a3..f3d201b3 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -153,8 +153,7 @@ class _VerificationMethodsScreenState extends State { 0.55, child: RichText( text: TextSpan( - text: TranslationBase.of(context) - .verifyWith, + text: TranslationBase.of(context).verifyWith, style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.w600, diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 8877aa29..d49b2bb4 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -26,7 +26,7 @@ class DashboardSliderItemWidget extends StatelessWidget { new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:13), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 68e1263b..8d90885f 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -26,7 +26,7 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 40 : 31); + (SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31); return Container( height: height, // height: 230, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index df1784c1..3c20526d 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -23,7 +23,7 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { double width = SizeConfig.heightMultiplier* - (SizeConfig.isHeightVeryShort ? 16 : 13); + (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( color: backgroundColor, width: width, diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index d8087c2f..ee587540 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; @@ -17,7 +16,6 @@ import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_scre import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/transitions/fade_page.dart'; @@ -156,7 +154,7 @@ class _HomeScreenState extends State { ? 16 : SizeConfig.isHeightShort ? 14 - : 13), + : SizeConfig.isHeightLarge?15:13), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 2d2f81e8..ca32106d 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -17,7 +17,7 @@ class MethodTypeCard extends StatelessWidget { @override Widget build(BuildContext context) { - double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : 20); + double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : SizeConfig.isHeightLarge?25:20); return InkWell( onTap: onTap, child: Container( diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 22d08932..30e889f8 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -9,7 +9,7 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:13); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13); return Container( width: width, padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index d83e4cd6..941109b7 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -13,7 +13,7 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { double barHeight = - SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 17); + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); diff --git a/pubspec.lock b/pubspec.lock index 25596d43..77df9848 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -629,7 +629,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -921,7 +921,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1119,5 +1119,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0" From 1edd375fd7002f8cd24e9f37ce918292fac4d5a9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 16:30:55 +0300 Subject: [PATCH 29/42] first step from special clinic --- lib/config/config.dart | 1 + lib/core/service/home/dasboard_service.dart | 26 +++++++++++++-- lib/core/viewModel/dashboard_view_model.dart | 14 ++++++++ ...cial_clinical_care_List_Respose_Model.dart | 32 +++++++++++++++++++ lib/screens/home/home_screen.dart | 2 ++ 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 588976ba..851eb832 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -219,6 +219,7 @@ const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RE const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; +const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; var selectedPatientType = 1; diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index b35d24f2..8bb0e586 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -1,10 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; class DashboardService extends BaseService { List _dashboardItemsList = []; List get dashboardItemsList => _dashboardItemsList; + + List _specialClinicalCareList = []; + List get specialClinicalCareList => _specialClinicalCareList; bool hasVirtualClinic = false; String sServiceID; @@ -24,8 +28,6 @@ class DashboardService extends BaseService { super.error = error; }, body: { - // "VidaAuthTokenID": - // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiZDYxZmM5MTQtZWFhYy00YjQ4LTgyMmEtMmE3OTNlZDMzZGYwIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NTgwOCIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgwMjg0NzQsImV4cCI6MTYwODg5MjQ3NCwiaWF0IjoxNjA4MDI4NDc0fQ.8OJcy6vUuPnNTi_qSjip8YCrFdaRLtJKbNKXcMtnQxk" }, ); } @@ -48,4 +50,24 @@ class DashboardService extends BaseService { }, ); } + Future getSpecialClinicalCareList() async { + hasError = false; + await getDoctorProfile(isGetProfile: true); + await baseAppClient.post( + GET_SPECIAL_CLINICAL_CARE_LIST, + onSuccess: (dynamic response, int statusCode) { + + _specialClinicalCareList.clear(); + response['List_SpecialClinicalCareList'].forEach((v) { + _specialClinicalCareList.add(GetSpecialClinicalCareListResponseModel.fromJson(v)); + });}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: { + }, + ); + } + } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index bbbef0b6..fe160c3c 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; @@ -22,6 +23,9 @@ class DashboardViewModel extends BaseViewModel { String get sServiceID => _dashboardService.sServiceID; + List get specialClinicalCareList => _dashboardService.specialClinicalCareList; + + Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); @@ -64,6 +68,16 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getSpecialClinicalCareList() async { + setState(ViewState.Busy); + await _dashboardService.getSpecialClinicalCareList(); + if (_dashboardService.hasError) { + error = _dashboardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future changeClinic( int clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); diff --git a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart new file mode 100644 index 00000000..ec19abb0 --- /dev/null +++ b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart @@ -0,0 +1,32 @@ +class GetSpecialClinicalCareListResponseModel { + int projectID; + int clinicID; + String clinicDescription; + String clinicDescriptionN; + bool isActive; + + GetSpecialClinicalCareListResponseModel( + {this.projectID, + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.isActive}); + + GetSpecialClinicalCareListResponseModel.fromJson(Map json) { + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['IsActive'] = this.isActive; + return data; + } +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 85ea3506..eba91cc2 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -69,6 +69,8 @@ class _HomeScreenState extends State { await model.getDashboard(); await model.getDoctorProfile(isGetProfile: true); await model.checkDoctorHasLiveCare(); + + await model.getSpecialClinicalCareList(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, From 3913f8936c14894c4871fb1790804e4fe44a2d23 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 14 Jun 2021 17:03:09 +0300 Subject: [PATCH 30/42] Scan QR Code fix --- lib/config/config.dart | 4 +- lib/core/service/patient/patient_service.dart | 57 ++++++-- lib/core/viewModel/patient_view_model.dart | 61 ++++---- lib/screens/qr_reader/QR_reader_screen.dart | 134 +++--------------- 4 files changed, 94 insertions(+), 162 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 492d7ada..f2dbbf18 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index e15cc8d1..25e9481b 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequenc import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result_req_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; @@ -22,20 +24,19 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_mode class PatientService extends BaseService { List _patientVitalSignList = []; List patientVitalSignOrderdSubList = []; + List inPatientList = List(); + List myInPatientList = List(); List get patientVitalSignList => _patientVitalSignList; List _patientLabResultOrdersList = []; - List get patientLabResultOrdersList => - _patientLabResultOrdersList; + List get patientLabResultOrdersList => _patientLabResultOrdersList; - List get patientPrescriptionsList => - _patientPrescriptionsList; + List get patientPrescriptionsList => _patientPrescriptionsList; List _patientPrescriptionsList = []; - List get prescriptionReportForInPatientList => - _prescriptionReportForInPatientList; + List get prescriptionReportForInPatientList => _prescriptionReportForInPatientList; List _prescriptionReportForInPatientList = []; List _patientRadiologyList = []; @@ -79,12 +80,9 @@ class PatientService extends BaseService { get referalFrequancyList => _referalFrequancyList; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = - DoctorsByClinicIdRequest(); - STPReferralFrequencyRequest _referralFrequencyRequest = - STPReferralFrequencyRequest(); - ClinicByProjectIdRequest _clinicByProjectIdRequest = - ClinicByProjectIdRequest(); + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); + STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); ReferToDoctorRequest _referToDoctorRequest; Future getPatientList(patient, patientType, {isView}) async { @@ -138,6 +136,38 @@ class PatientService extends BaseService { return Future.value(localRes); } + Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { + hasError = false; + await getDoctorProfile(); + + if (isMyInpatient) { + requestModel.doctorID = doctorProfile.doctorID; + } else { + requestModel.doctorID = 0; + } + + await baseAppClient.post( + GET_PATIENT_IN_PATIENT_LIST, + onSuccess: (dynamic response, int statusCode) { + inPatientList.clear(); + myInPatientList.clear(); + + response['List_MyInPatient'].forEach((v) { + PatiantInformtion patient = PatiantInformtion.fromJson(v); + inPatientList.add(patient); + if (patient.doctorId == doctorProfile.doctorID) { + myInPatientList.add(patient); + } + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: requestModel.toJson(), + ); + } + Future getLabResultOrders(patient) async { hasError = false; await baseAppClient.post( @@ -181,8 +211,7 @@ class PatientService extends BaseService { onSuccess: (dynamic response, int statusCode) { _prescriptionReportForInPatientList = []; response['List_PrescriptionReportForInPatient'].forEach((v) { - prescriptionReportForInPatientList - .add(PrescriptionReportForInPatient.fromJson(v)); + prescriptionReportForInPatientList.add(PrescriptionReportForInPatient.fromJson(v)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index de40afde..5bc6250f 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -2,9 +2,11 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; @@ -17,51 +19,43 @@ import 'base_view_model.dart'; class PatientViewModel extends BaseViewModel { PatientService _patientService = locator(); - List get patientVitalSignList => - _patientService.patientVitalSignList; + List get inPatientList => _patientService.inPatientList; - List get patientVitalSignOrderdSubList => - _patientService.patientVitalSignOrderdSubList; + List get patientVitalSignList => _patientService.patientVitalSignList; - List get patientLabResultOrdersList => - _patientService.patientLabResultOrdersList; + List get patientVitalSignOrderdSubList => _patientService.patientVitalSignOrderdSubList; - List get patientPrescriptionsList => - _patientService.patientPrescriptionsList; + List get patientLabResultOrdersList => _patientService.patientLabResultOrdersList; + + List get patientPrescriptionsList => _patientService.patientPrescriptionsList; List get prescriptionReportForInPatientList => _patientService.prescriptionReportForInPatientList; - List get prescriptionReport => - _patientService.prescriptionReport; + List get prescriptionReport => _patientService.prescriptionReport; - List get patientRadiologyList => - _patientService.patientRadiologyList; + List get patientRadiologyList => _patientService.patientRadiologyList; List get labResultList => _patientService.labResultList; get insuranceApporvalsList => _patientService.insuranceApporvalsList; - List get patientProgressNoteList => - _patientService.patientProgressNoteList; + List get patientProgressNoteList => _patientService.patientProgressNoteList; List get clinicsList => _patientService.clinicsList; List get doctorsList => _patientService.doctorsList; - List get referralFrequencyList => - _patientService.referalFrequancyList; + List get referralFrequencyList => _patientService.referalFrequancyList; - Future getPatientList(patient, patientType, - {bool isBusyLocal = false, isView}) async { + Future getPatientList(patient, patientType, {bool isBusyLocal = false, isView}) async { var localRes; if (isBusyLocal) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - localRes = await _patientService.getPatientList(patient, patientType, - isView: isView); + localRes = await _patientService.getPatientList(patient, patientType, isView: isView); if (_patientService.hasError) { error = _patientService.error; @@ -210,16 +204,12 @@ class PatientViewModel extends BaseViewModel { } List getDoctorNameList() { - var doctorNamelist = _patientService.doctorsList - .map((value) => value['DoctorName'].toString()) - .toList(); + var doctorNamelist = _patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList(); return doctorNamelist; } List getClinicNameList() { - var clinicsNameslist = _patientService.clinicsList - .map((value) => value['ClinicDescription'].toString()) - .toList(); + var clinicsNameslist = _patientService.clinicsList.map((value) => value['ClinicDescription'].toString()).toList(); return clinicsNameslist; } @@ -234,9 +224,8 @@ class PatientViewModel extends BaseViewModel { } List getReferralNamesList() { - var referralNamesList = _patientService.referalFrequancyList - .map((value) => value['Description'].toString()) - .toList(); + var referralNamesList = + _patientService.referalFrequancyList.map((value) => value['Description'].toString()).toList(); return referralNamesList; } @@ -281,4 +270,18 @@ class PatientViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { + await getDoctorProfile(); + setState(ViewState.Busy); + + await _patientService.getInPatient(requestModel, false); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.ErrorLocal); + } else { + // setDefaultInPatientList(); + setState(ViewState.Idle); + } + } } diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index a411aaa7..848b3f9a 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -1,11 +1,8 @@ import 'package:barcode_scan_fix/barcode_scan.dart'; -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/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; -import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -26,38 +23,9 @@ class QrReaderScreen extends StatefulWidget { } class _QrReaderScreenState extends State { - DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - - bool isLoading = false; - bool isError = false; - PatientModel patient = PatientModel( - ProjectID: 15, - ClinicID: 0, - DoctorID: 1485, - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: "0", - To: "0", - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 5.5, - Channel: 9, - TokenID: "@dm!n", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); - List patientList = []; - String error = ''; - @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -95,26 +63,8 @@ class _QrReaderScreenState extends State { onPressed: () { _scanQrAndGetPatient(context, model); }, - loading: isLoading, icon: Image.asset('assets/images/qr_code_white.png'), ), - isError - ? Container( - margin: EdgeInsets.only(top: 8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Theme.of(context).errorColor.withOpacity(0.06), - ), - padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0), - child: Row( - children: [ - Expanded( - child: AppText(error ?? TranslationBase.of(context).errorMessage, - color: Theme.of(context).errorColor)), - ], - ), - ) - : Container(), ], ), ), @@ -131,75 +81,25 @@ class _QrReaderScreenState extends State { var result = await BarcodeScanner.scan(); if (result != "") { List listOfParams = result.split(','); - String patientType = "1"; - setState(() { - isLoading = true; - isError = false; - patientList = []; - }); - String token = await sharedPref.getString(TOKEN); -// Map profile = await sharedPref.getObj(DOCTOR_PROFILE); -// DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); -// patient.PatientID = 8808; -// patient.TokenID = token; -// patient.setDoctorID = doctorProfile.projectID; -// patient.setClinicID = doctorProfile.clinicID; -// patient.setProjectID = doctorProfile.projectID; -// Provider.of(context, listen: false); - patient.PatientID = 8808; - patient.TokenID = token; - model.getPatientList(patient, "1", isBusyLocal: true).then((response) { - if (response['MessageStatus'] == 1) { - switch (patientType) { - case "0": - if (response['List_MyOutPatient'] != null) { - setState(() { - patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list; - isLoading = false; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - isError = true; - isLoading = false; - }); - DrAppToastMsg.showErrorToast('No patient'); - } - break; - case "1": - if (response['List_MyInPatient'] != null) { - setState(() { - patientList = ModelResponse.fromJson(response['List_MyInPatient']).list; - isLoading = false; - error = ""; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - isError = true; - isLoading = false; - }); - DrAppToastMsg.showErrorToast('No patient'); - break; - } - } + int patientID = 0; + if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); + PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( + patientID: patientID, + ); + + await model.getInPatientList(patientSearchRequestModel, isMyInpatient: true).then((d) { + if (model.state != ViewState.ErrorLocal) { + if (model.inPatientList.isEmpty) + DrAppToastMsg.showErrorToast('No patient'); + else + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.inPatientList[0], + }); } else { - setState(() { - isLoading = false; - isError = true; - }); - DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']); + DrAppToastMsg.showErrorToast(model.error); } }).catchError((error) { - setState(() { - isLoading = false; - }); Helpers.showErrorToast(error.message); - //DrAppToastMsg.showErrorToast(error); }); } } From 363b55069faf22e4696ebf875f256caf0bca563c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 18:04:20 +0300 Subject: [PATCH 31/42] first step form Special Clinic --- lib/config/config.dart | 1 + .../PatientSearchRequestModel.dart | 32 ++-- lib/core/service/home/dasboard_service.dart | 21 --- .../special_clinic_service.dart | 57 +++++++ .../viewModel/PatientSearchViewModel.dart | 42 +++++- lib/core/viewModel/dashboard_view_model.dart | 23 ++- lib/locator.dart | 2 + ...nical_care_mapping_List_Respose_Model.dart | 37 +++++ lib/screens/home/home_screen.dart | 3 +- .../patients/PatientsInPatientScreen.dart | 142 +++++++++++++++++- 10 files changed, 315 insertions(+), 45 deletions(-) create mode 100644 lib/core/service/special_clinics/special_clinic_service.dart create mode 100644 lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index c8eac881..eb361798 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -226,6 +226,7 @@ const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoc const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; +const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; var selectedPatientType = 1; diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 437c5885..2918a393 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -11,20 +11,24 @@ class PatientSearchRequestModel { int searchType; String mobileNo; String identificationNo; + int nursingStationID; + int clinicID; PatientSearchRequestModel( - {this.doctorID =0, - this.firstName ="0", - this.middleName ="0", - this.lastName ="0", - this.patientMobileNumber ="0", - this.patientIdentificationID ="0", - this.patientID =0, - this.searchType =1, - this.mobileNo="", - this.identificationNo="0", - this.from ="0", - this.to ="0"}); + {this.doctorID = 0, + this.firstName = "0", + this.middleName = "0", + this.lastName = "0", + this.patientMobileNumber = "0", + this.patientIdentificationID = "0", + this.patientID = 0, + this.searchType = 1, + this.mobileNo = "", + this.identificationNo = "0", + this.from = "0", + this.to = "0", + this.clinicID, + this.nursingStationID = 0}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -39,6 +43,8 @@ class PatientSearchRequestModel { searchType = json['SearchType']; mobileNo = json['MobileNo']; identificationNo = json['IdentificationNo']; + nursingStationID = json['NursingStationID']; + clinicID = json['ClinicID']; } Map toJson() { @@ -55,6 +61,8 @@ class PatientSearchRequestModel { data['SearchType'] = this.searchType; data['MobileNo'] = this.mobileNo; data['IdentificationNo'] = this.identificationNo; + data['NursingStationID'] = this.nursingStationID; + data['ClinicID'] = this.clinicID; return data; } } diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index 8bb0e586..ad3ec887 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -7,8 +7,6 @@ class DashboardService extends BaseService { List _dashboardItemsList = []; List get dashboardItemsList => _dashboardItemsList; - List _specialClinicalCareList = []; - List get specialClinicalCareList => _specialClinicalCareList; bool hasVirtualClinic = false; String sServiceID; @@ -50,24 +48,5 @@ class DashboardService extends BaseService { }, ); } - Future getSpecialClinicalCareList() async { - hasError = false; - await getDoctorProfile(isGetProfile: true); - await baseAppClient.post( - GET_SPECIAL_CLINICAL_CARE_LIST, - onSuccess: (dynamic response, int statusCode) { - - _specialClinicalCareList.clear(); - response['List_SpecialClinicalCareList'].forEach((v) { - _specialClinicalCareList.add(GetSpecialClinicalCareListResponseModel.fromJson(v)); - });}, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: { - }, - ); - } } diff --git a/lib/core/service/special_clinics/special_clinic_service.dart b/lib/core/service/special_clinics/special_clinic_service.dart new file mode 100644 index 00000000..49237331 --- /dev/null +++ b/lib/core/service/special_clinics/special_clinic_service.dart @@ -0,0 +1,57 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; + +class SpecialClinicsService extends BaseService { + + + List _specialClinicalCareList = []; + List get specialClinicalCareList => _specialClinicalCareList; + + List _specialClinicalCareMappingList = []; + List get specialClinicalCareMappingList => _specialClinicalCareMappingList; + Future getSpecialClinicalCareList() async { + hasError = false; + await baseAppClient.post( + GET_SPECIAL_CLINICAL_CARE_LIST, + onSuccess: (dynamic response, int statusCode) { + + _specialClinicalCareList.clear(); + response['List_SpecialClinicalCareList'].forEach((v) { + _specialClinicalCareList.add(GetSpecialClinicalCareListResponseModel.fromJson(v)); + });}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: { + }, + ); + } + + + Future getSpecialClinicalCareMappingList(int clinicId) async { + hasError = false; + await baseAppClient.post( + GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST, + onSuccess: (dynamic response, int statusCode) { + + _specialClinicalCareMappingList.clear(); + response['List_SpecialClinicalCareMappingList'].forEach((v) { + _specialClinicalCareMappingList.add(GetSpecialClinicalCareMappingListResponseModel.fromJson(v)); + });}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: { + "ClinicID": clinicId, + "DoctorID":0, + "EditedBy":0 + }, + ); + } + +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index a0cd68d9..6b83461b 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart'; +import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -12,8 +14,10 @@ import 'base_view_model.dart'; class PatientSearchViewModel extends BaseViewModel { OutPatientService _outPatientService = locator(); + SpecialClinicsService _specialClinicsService = locator(); List get patientList => _outPatientService.patientList; + List get specialClinicalCareMappingList => _specialClinicsService.specialClinicalCareMappingList; List filterData = []; @@ -143,15 +147,22 @@ class PatientSearchViewModel extends BaseViewModel { List filteredInPatientItems = List(); Future getInPatientList(PatientSearchRequestModel requestModel, - {bool isMyInpatient = false}) async { + {bool isMyInpatient = false, bool isLocalBusy = false}) async { await getDoctorProfile(); - setState(ViewState.Busy); - + if(isLocalBusy) { + setState(ViewState.BusyLocal); + } else{ + setState(ViewState.Busy); + } if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error; + if(isLocalBusy) { + setState(ViewState.ErrorLocal); + } else{ setState(ViewState.Error); + } } else { // setDefaultInPatientList(); setState(ViewState.Idle); @@ -166,6 +177,9 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.Idle); } + + + void clearPatientList() { _inPatientService.inPatientList = []; _inPatientService.myInPatientList = []; @@ -195,4 +209,26 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } } + + + getSpecialClinicalCareMappingList(clinicId, + {bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + //TODO Elham* change clinic id to dynamic + await _specialClinicsService.getSpecialClinicalCareMappingList(221); + if (_specialClinicsService.hasError) { + error = _specialClinicsService.error; + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index fe160c3c..95028f52 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; +import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; @@ -15,6 +16,7 @@ import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); DashboardService _dashboardService = locator(); + SpecialClinicsService _specialClinicsService = locator(); List get dashboardItemsList => _dashboardService.dashboardItemsList; @@ -23,7 +25,7 @@ class DashboardViewModel extends BaseViewModel { String get sServiceID => _dashboardService.sServiceID; - List get specialClinicalCareList => _dashboardService.specialClinicalCareList; + List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; Future setFirebaseNotification(ProjectViewModel projectsProvider, @@ -70,9 +72,9 @@ class DashboardViewModel extends BaseViewModel { Future getSpecialClinicalCareList() async { setState(ViewState.Busy); - await _dashboardService.getSpecialClinicalCareList(); - if (_dashboardService.hasError) { - error = _dashboardService.error; + await _specialClinicsService.getSpecialClinicalCareList(); + if (_specialClinicsService.hasError) { + error = _specialClinicsService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -99,4 +101,17 @@ class DashboardViewModel extends BaseViewModel { return value.toString(); } + + + bool isSpecialClinic(clinicId){ + bool isSpecial = false; + specialClinicalCareList.forEach((element) { + if(element.clinicID == 1){ + isSpecial = true; + } + }); + + return isSpecial; + + } } diff --git a/lib/locator.dart b/lib/locator.dart index 1c491b54..de493196 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -37,6 +37,7 @@ import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'core/service/patient_medical_file/soap/SOAP_service.dart'; import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; +import 'core/service/special_clinics/special_clinic_service.dart'; import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart'; @@ -91,6 +92,7 @@ void setupLocator() { locator.registerLazySingleton(() => PatientMedicalReportService()); locator.registerLazySingleton(() => LiveCarePatientServices()); locator.registerLazySingleton(() => NavigationService()); + locator.registerLazySingleton(() => SpecialClinicsService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart new file mode 100644 index 00000000..287f40f1 --- /dev/null +++ b/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart @@ -0,0 +1,37 @@ +class GetSpecialClinicalCareMappingListResponseModel { + int mappingProjectID; + int clinicID; + int nursingStationID; + bool isActive; + int projectID; + String description; + + GetSpecialClinicalCareMappingListResponseModel( + {this.mappingProjectID, + this.clinicID, + this.nursingStationID, + this.isActive, + this.projectID, + this.description}); + + GetSpecialClinicalCareMappingListResponseModel.fromJson( + Map json) { + mappingProjectID = json['MappingProjectID']; + clinicID = json['ClinicID']; + nursingStationID = json['NursingStationID']; + isActive = json['IsActive']; + projectID = json['ProjectID']; + description = json['Description']; + } + + Map toJson() { + final Map data = new Map(); + data['MappingProjectID'] = this.mappingProjectID; + data['ClinicID'] = this.clinicID; + data['NursingStationID'] = this.nursingStationID; + data['IsActive'] = this.isActive; + data['ProjectID'] = this.projectID; + data['Description'] = this.description; + return data; + } +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index f2a8da6a..294541b0 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -69,7 +69,6 @@ class _HomeScreenState extends State { await model.getDashboard(); await model.getDoctorProfile(isGetProfile: true); await model.checkDoctorHasLiveCare(); - await model.getSpecialClinicalCareList(); }, builder: (_, model, w) => AppScaffold( @@ -356,7 +355,7 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(), + page: PatientInPatientScreen(specialClinic: model.specialClinicalCareList[0],), ), ); }, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 60446887..1d8e91b9 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -1,17 +1,27 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.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'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'DischargedPatientPage.dart'; import 'InPatientPage.dart'; class PatientInPatientScreen extends StatefulWidget { + GetSpecialClinicalCareListResponseModel specialClinic; + + PatientInPatientScreen({Key key, this.specialClinic}); + @override _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); } @@ -21,6 +31,9 @@ class _PatientInPatientScreenState extends State TabController _tabController; int _activeTab = 0; + int selectedMapId; + + @override void initState() { super.initState(); @@ -42,15 +55,23 @@ class _PatientInPatientScreenState extends State @override Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; + final screenSize = MediaQuery + .of(context) + .size; PatientSearchRequestModel requestModel = PatientSearchRequestModel(); + ProjectViewModel projectsProvider = Provider.of(context); + return BaseView( onModelReady: (model) async { model.clearPatientList(); + if (widget.specialClinic != null) + await model.getSpecialClinicalCareMappingList( + widget.specialClinic.clinicID); model.getInPatientList(requestModel); }, - builder: (_, model, w) => AppScaffold( + builder: (_, model, w) => + AppScaffold( baseViewModel: model, isShowAppBar: false, body: Column( @@ -72,12 +93,127 @@ class _PatientInPatientScreenState extends State ), Expanded( child: AppText( - TranslationBase.of(context).inPatient, + TranslationBase + .of(context) + .inPatient, fontSize: SizeConfig.textMultiplier * 2.8, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), ), ), + if(model.specialClinicalCareMappingList.isNotEmpty && + widget.specialClinic != null) + Container( + width: MediaQuery + .of(context) + .size + .width * .3, + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedMapId == null ? model + .specialClinicalCareMappingList[0] + .nursingStationID : selectedMapId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return model + .specialClinicalCareMappingList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Container( + padding: + EdgeInsets.all(2), + margin: + EdgeInsets.all(2), + decoration: + new BoxDecoration( + color: + Colors.red[800], + borderRadius: + BorderRadius + .circular( + 20), + ), + constraints: + BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + model + .specialClinicalCareMappingList + .length + .toString(), + color: + Colors.white, + fontSize: + projectsProvider + .isArabic + ? 10 + : 11, + textAlign: + TextAlign + .center, + ), + )), + ], + ), + AppText(item.description, + fontSize: 12, + color: Colors.black, + fontWeight: + FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + setState(() { + selectedMapId = newValue; + }); + model.clearPatientList(); + GifLoaderDialogUtils.showMyDialog( + context); + + PatientSearchRequestModel requestModel = PatientSearchRequestModel( + nursingStationID: selectedMapId, clinicID: 0); + await model.getInPatientList(requestModel, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog( + context); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } + }, + items: model + .specialClinicalCareMappingList + .map((item) { + return DropdownMenuItem( + child: AppText( + item.description, + textAlign: TextAlign.left, + ), + value: item.nursingStationID, + ); + }).toList(), + )), + ) ]), ), ), From 7b71bd752fd892334fa20a953ce033dd65a7ecce Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 18:08:24 +0300 Subject: [PATCH 32/42] add to do --- lib/screens/patients/PatientsInPatientScreen.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 1d8e91b9..fe908b8d 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -68,6 +68,8 @@ class _PatientInPatientScreenState extends State if (widget.specialClinic != null) await model.getSpecialClinicalCareMappingList( widget.specialClinic.clinicID); + + //TODO Elham* check why he call it without await and handel the special clinic part. model.getInPatientList(requestModel); }, builder: (_, model, w) => From 7f3ae19fd2394002b8d2407c298136b098a00a83 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 15 Jun 2021 09:42:50 +0300 Subject: [PATCH 33/42] remove todo --- lib/screens/patients/PatientsInPatientScreen.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index fe908b8d..1d8e91b9 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -68,8 +68,6 @@ class _PatientInPatientScreenState extends State if (widget.specialClinic != null) await model.getSpecialClinicalCareMappingList( widget.specialClinic.clinicID); - - //TODO Elham* check why he call it without await and handel the special clinic part. model.getInPatientList(requestModel); }, builder: (_, model, w) => From 1c3391baed0787bf6833599d7443104a5c08544b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 15 Jun 2021 12:04:37 +0300 Subject: [PATCH 34/42] Scan qr code refactoring --- lib/core/service/home/scan_qr_service.dart | 41 +++++++++++++++++++++ lib/core/viewModel/scan_qr_view_model.dart | 26 +++++++++++++ lib/locator.dart | 4 ++ lib/screens/qr_reader/QR_reader_screen.dart | 5 ++- 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 lib/core/service/home/scan_qr_service.dart create mode 100644 lib/core/viewModel/scan_qr_view_model.dart diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart new file mode 100644 index 00000000..bc6c8820 --- /dev/null +++ b/lib/core/service/home/scan_qr_service.dart @@ -0,0 +1,41 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class ScanQrService extends BaseService { + List myInPatientList = List(); + List inPatientList = List(); + + Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { + hasError = false; + await getDoctorProfile(); + + if (isMyInpatient) { + requestModel.doctorID = doctorProfile.doctorID; + } else { + requestModel.doctorID = 0; + } + + await baseAppClient.post( + GET_PATIENT_IN_PATIENT_LIST, + onSuccess: (dynamic response, int statusCode) { + inPatientList.clear(); + myInPatientList.clear(); + + response['List_MyInPatient'].forEach((v) { + PatiantInformtion patient = PatiantInformtion.fromJson(v); + inPatientList.add(patient); + if (patient.doctorId == doctorProfile.doctorID) { + myInPatientList.add(patient); + } + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: requestModel.toJson(), + ); + } +} diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart new file mode 100644 index 00000000..ff934f79 --- /dev/null +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -0,0 +1,26 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class ScanQrViewModel extends BaseViewModel { + ScanQrService _scanQrService = locator(); + List get inPatientList => _scanQrService.inPatientList; + + Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { + await getDoctorProfile(); + setState(ViewState.Busy); + + await _scanQrService.getInPatient(requestModel, false); + if (_scanQrService.hasError) { + error = _scanQrService.error; + + setState(ViewState.ErrorLocal); + } else { + // setDefaultInPatientList(); + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 1c491b54..0b5d8c5c 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,10 +1,12 @@ import 'package:doctor_app_flutter/core/service/authentication_service.dart'; +import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; @@ -91,6 +93,7 @@ void setupLocator() { locator.registerLazySingleton(() => PatientMedicalReportService()); locator.registerLazySingleton(() => LiveCarePatientServices()); locator.registerLazySingleton(() => NavigationService()); + locator.registerLazySingleton(() => ScanQrService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -118,4 +121,5 @@ void setupLocator() { locator.registerFactory(() => HospitalViewModel()); locator.registerFactory(() => LiveCarePatientViewModel()); locator.registerFactory(() => PatientMedicalReportViewModel()); + locator.registerFactory(() => ScanQrViewModel()); } diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 848b3f9a..c70563f9 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -25,7 +26,7 @@ class QrReaderScreen extends StatefulWidget { class _QrReaderScreenState extends State { @override Widget build(BuildContext context) { - return BaseView( + return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -74,7 +75,7 @@ class _QrReaderScreenState extends State { ); } - _scanQrAndGetPatient(BuildContext context, PatientViewModel model) async { + _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { /// When give qr we will change this method to get data /// var result = await BarcodeScanner.scan(); /// int patientID = get from qr result From 37e68539769ba73a3c924b564f4338d7d8a765b4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 15 Jun 2021 12:10:04 +0300 Subject: [PATCH 35/42] add special one first calling --- .../patients/PatientsInPatientScreen.dart | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 1d8e91b9..4971b636 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -65,9 +65,13 @@ class _PatientInPatientScreenState extends State return BaseView( onModelReady: (model) async { model.clearPatientList(); - if (widget.specialClinic != null) - await model.getSpecialClinicalCareMappingList( - widget.specialClinic.clinicID); + if (widget.specialClinic != null) { + await model + .getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); + requestModel.nursingStationID = + model.specialClinicalCareMappingList[0].nursingStationID; + requestModel.clinicID = 0; + } model.getInPatientList(requestModel); }, builder: (_, model, w) => @@ -101,19 +105,17 @@ class _PatientInPatientScreenState extends State color: Color(0xFF2B353E), ), ), - if(model.specialClinicalCareMappingList.isNotEmpty && - widget.specialClinic != null) + if (model.specialClinicalCareMappingList.isNotEmpty && + widget.specialClinic != null && + _activeTab != 2) Container( - width: MediaQuery - .of(context) - .size - .width * .3, + width: MediaQuery.of(context).size.width * .3, child: DropdownButtonHideUnderline( child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedMapId == null ? model + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedMapId == null ? model .specialClinicalCareMappingList[0] .nursingStationID : selectedMapId, iconSize: 25, From fee36336d8e1967ea0cd14326980f74265500e8f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 15 Jun 2021 14:40:11 +0300 Subject: [PATCH 36/42] fix out patient header --- lib/widgets/patients/profile/patient-profile-app-bar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 1a47dd00..5cfdc1b6 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -273,7 +273,7 @@ class PatientProfileAppBar extends StatelessWidget ), ), - if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty) + if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) Row( mainAxisAlignment: MainAxisAlignment.start, children: [ From 3cf4ef43488466248c6aed4bbfdafca1229012e7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 15 Jun 2021 14:57:42 +0300 Subject: [PATCH 37/42] check if special in home page --- lib/core/viewModel/dashboard_view_model.dart | 8 ++++---- lib/screens/home/home_screen.dart | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 95028f52..f35a4a2a 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -103,15 +103,15 @@ class DashboardViewModel extends BaseViewModel { } - bool isSpecialClinic(clinicId){ - bool isSpecial = false; + GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){ + GetSpecialClinicalCareListResponseModel special ; specialClinicalCareList.forEach((element) { if(element.clinicID == 1){ - isSpecial = true; + special = element; } }); - return isSpecial; + return special; } } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 294541b0..aaf4d9b9 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -288,7 +288,7 @@ class _HomeScreenState extends State { child: ListView( scrollDirection: Axis.horizontal, children: [ - ...homePatientsCardsWidget(model), + ...homePatientsCardsWidget(model, projectsProvider), ])), SizedBox( height: 20, @@ -306,7 +306,7 @@ class _HomeScreenState extends State { ); } - List homePatientsCardsWidget(DashboardViewModel model) { + List homePatientsCardsWidget(DashboardViewModel model,projectsProvider) { colorIndex = 0; List backgroundColors = List(3); @@ -355,7 +355,8 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(specialClinic: model.specialClinicalCareList[0],), + page: PatientInPatientScreen(specialClinic: model.getSpecialClinic(clinicId??projectsProvider + .doctorClinicsList[0].clinicID),), ), ); }, From f76bac898bc81ca10544ed7e107c6a9e68efb2a0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 15 Jun 2021 15:20:33 +0300 Subject: [PATCH 38/42] make clinic id dynamic --- lib/core/viewModel/PatientSearchViewModel.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 6b83461b..e0ee8948 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -218,8 +218,7 @@ class PatientSearchViewModel extends BaseViewModel { } else { setState(ViewState.Busy); } - //TODO Elham* change clinic id to dynamic - await _specialClinicsService.getSpecialClinicalCareMappingList(221); + await _specialClinicsService.getSpecialClinicalCareMappingList(clinicId); if (_specialClinicsService.hasError) { error = _specialClinicsService.error; if (isLocalBusy) { From c1ed1dc737fbdb27c0b5c2353a10296f0693d4b8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 16 Jun 2021 11:13:35 +0300 Subject: [PATCH 39/42] add loader --- lib/screens/patients/InPatientPage.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index e9e2c2d1..ec2a8107 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -1,9 +1,12 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; @@ -59,7 +62,7 @@ class _InPatientPageState extends State { model.filterSearchResults(value); }), ), - model.filteredInPatientItems.length > 0 + model.state == ViewState.Idle?model.filteredInPatientItems.length > 0 ? Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 16.0), @@ -154,6 +157,13 @@ class _InPatientPageState extends State { error: TranslationBase.of(context).noDataAvailable)), ), + ): Center( + child: Container( + height: 300, + width: 300, + child: Image.asset( + "assets/images/progress-loading-red.gif"), + ), ), ], ), From 78903043d95aa89cc135ee4dbf0788bbadfbc3d7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 16 Jun 2021 16:18:54 +0300 Subject: [PATCH 40/42] fix header --- .../patients/profile/lab_result/laboratory_result_page.dart | 2 +- lib/screens/patients/profile/lab_result/labs_home_page.dart | 1 - lib/widgets/patients/profile/patient-profile-app-bar.dart | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index d6b4d2bc..e58d4ef5 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -40,7 +40,7 @@ class _LaboratoryResultPageState extends State { isShowAppBar: true, appBar: PatientProfileAppBar( widget.patient, - + isInpatient:widget.isInpatient, isFromLabResult: true, appointmentDate: widget.patientLabOrders.orderDate, ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index b2bfa2fd..7da55967 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -54,7 +54,6 @@ class _LabsHomePageState extends State { isShowAppBar: true, appBar: PatientProfileAppBar( patient, - isInpatient: isInpatient, ), body: SingleChildScrollView( diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 5cfdc1b6..497e8ad5 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -551,6 +551,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? 160 : isAppointmentHeader ? 290 : 170 + ? isInpatient ? (isFromLabResult?170:175) : isAppointmentHeader ? 290 : 175 : height); } From b9711fce653035bc97f559f8a1e01b1554172f7d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 16 Jun 2021 16:35:48 +0300 Subject: [PATCH 41/42] fix header from lab result details --- lib/widgets/patients/profile/patient-profile-app-bar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 497e8ad5..e39cd5f6 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -551,6 +551,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? (isFromLabResult?170:175) : isAppointmentHeader ? 290 : 175 + ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : 175 : height); } From 4e6237f2ce31ad216349d267fff1ed149e0ed0d2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 16 Jun 2021 16:47:03 +0300 Subject: [PATCH 42/42] fix header from lab --- lib/config/config.dart | 4 ++-- lib/widgets/patients/profile/patient-profile-app-bar.dart | 2 +- pubspec.lock | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 8241b36c..eb361798 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index e39cd5f6..83186b02 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -551,6 +551,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : 175 + ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : 170 : height); } diff --git a/pubspec.lock b/pubspec.lock index 25596d43..77df9848 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -629,7 +629,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -921,7 +921,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1119,5 +1119,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0"