From 837ff69c8259c44ef672f2884f8c992ff7930087 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 23 May 2021 16:33:20 +0300 Subject: [PATCH 001/124] 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 002/124] 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 003/124] 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 004/124] 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 005/124] 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 006/124] 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 007/124] 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 008/124] 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 009/124] 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 010/124] 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 011/124] 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 012/124] 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 9454e9d8affc47a8ed54c0b5dcd712337d8e5dbd Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 31 May 2021 16:59:28 +0300 Subject: [PATCH 013/124] working on procedure refactoring --- lib/config/localized_values.dart | 8 + .../procedure/procedure_service.dart | 2 +- .../radiology/radiology_service.dart | 3 + .../profile/lab_result/labs_home_page.dart | 14 +- .../radiology/radiology_home_page.dart | 38 +-- lib/screens/procedures/ProcedureType.dart | 5 + .../procedures/add-favourite-procedure.dart | 4 - .../procedures/add-procedure-form.dart | 142 ++++++------ .../procedures/add_lab_home_screen.dart | 218 ----------------- .../procedures/add_radiology_screen.dart | 219 ------------------ ....dart => base_add_procedure_tab_page.dart} | 110 +++++++-- lib/screens/procedures/procedure_screen.dart | 13 +- lib/util/translations_delegate_base.dart | 6 + 13 files changed, 215 insertions(+), 567 deletions(-) create mode 100644 lib/screens/procedures/ProcedureType.dart delete mode 100644 lib/screens/procedures/add_lab_home_screen.dart delete mode 100644 lib/screens/procedures/add_radiology_screen.dart rename lib/screens/procedures/{add_procedure_homeScreen.dart => base_add_procedure_tab_page.dart} (60%) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 231e7f9b..4d3c0e78 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -651,6 +651,10 @@ const Map> localizedValues = { 'en': "add Selected Procedures", 'ar': "اضافة العمليات المختارة " }, + 'addProcedures': { + 'en': "Add Procedure", + 'ar': "اضافة العمليات" + }, 'updateProcedure': {'en': "Update Procedure", 'ar': "تحديث العملية"}, 'orderProcedure': {'en': "order procedure", 'ar': "طلب العمليات"}, 'nameOrICD': {'en': "Name or ICD", 'ar': "الاسم او  ICD"}, @@ -998,4 +1002,8 @@ const Map> localizedValues = { "onHold": {"en": "On Hold", "ar": "قيد الانتظار"}, "verified": {"en": "Verified", "ar": "تم التحقق"}, "endCall": {"en": "End Call", "ar": "انهاء"}, + "favoriteTemplates": {"en": "Favorite Templates", "ar": "القوالب المفضلة"}, + "allProcedures": {"en": "All Procedures", "ar": "كل الإجراءات"}, + "allRadiology": {"en": "All Radiology", "ar": "كل الأشعة"}, + "allLab": {"en": "All Lab", "ar": "كل المختبرات"}, }; diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 0c284f3d..526b2b3e 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -66,7 +66,7 @@ class ProcedureService extends BaseService { Future getProcedureTemplate( {int doctorId, int projectId, int clinicId, String categoryID}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( - tokenID: "@dm!n", + // tokenID: "@dm!n", patientID: 0, searchType: 1, ); diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 7cf17753..df646ca9 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -46,6 +46,9 @@ class RadiologyService extends BaseService { if (isInPatient) { label = "List_GetRadOreders"; } + if(response[label] == null || response[label].length == 0){ + label = "FinalRadiologyList"; + } response[label].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); 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 578e9f17..db3e6c21 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; -import 'package:doctor_app_flutter/screens/procedures/add_lab_home_screen.dart'; -import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; +import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; @@ -112,10 +112,12 @@ class _LabsHomePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddLabHomeScreen( - patient: patient, - model: model, - )), + builder: (context) => BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.LAB_RESULT, + ), + ), ); }, label: TranslationBase.of(context).applyForNewLabOrder, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 4e969793..9f93df35 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; -import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; -import 'package:doctor_app_flutter/screens/procedures/add_radiology_screen.dart'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; +import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; @@ -100,9 +100,7 @@ class _RadiologyHomePageState extends State { fontSize: 13, ), AppText( - TranslationBase - .of(context) - .result, + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -110,18 +108,19 @@ class _RadiologyHomePageState extends State { ), ), if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - AddRadiologyScreen( - patient: patient, - model: model, - )), + builder: (context) => BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.RADIOLOGY, + ), + ), ); }, label: TranslationBase.of(context).applyForRadiologyOrder, @@ -153,11 +152,18 @@ class _RadiologyHomePageState extends State { ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), - bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), - topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), - bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) - ), + topLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + topRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + bottomRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0)), ), child: RotatedBox( quarterTurns: 3, diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart new file mode 100644 index 00000000..e05fb7e1 --- /dev/null +++ b/lib/screens/procedures/ProcedureType.dart @@ -0,0 +1,5 @@ +enum ProcedureType { + PROCEDURE, + LAB_RESULT, + RADIOLOGY, +} \ No newline at end of file diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 9b5a97ad..a68336c7 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -1,12 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart'; -import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_checkout_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 354ada19..ba2ec3de 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -17,81 +17,9 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'ProcedureType.dart'; import 'entity_list_checkbox_search_widget.dart'; -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); - - procedureValadteRequestModel.patientMRN = patient.appointmentNo; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; -} - -postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { - PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient.patientMRN; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - - List controlsProcedure = List(); - - postProcedureReqModel.appointmentNo = patient.appointmentNo; - - postProcedureReqModel.episodeID = patient.episodeNo; - postProcedureReqModel.patientMRN = patient.patientMRN; - - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); - controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), - ); - controls.add( - Controls(code: "ordertype", controlValue: element.type ?? "1"), - ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); - }); - - postProcedureReqModel.procedures = controlsProcedure; - await model.valadteProcedure(procedureValadteRequestModel); - if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { - await model.postProcedure(postProcedureReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('procedure has been added'); - } - } else { - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); - } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); - } - } - } else { - Helpers.showErrorToast(model.error); - } -} - void addSelectedProcedure( context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( @@ -108,8 +36,9 @@ void addSelectedProcedure( class AddSelectedProcedure extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; + final ProcedureType procedureType; - const AddSelectedProcedure({Key key, this.model, this.patient}) + const AddSelectedProcedure({Key key, this.model, this.patient, this.procedureType}) : super(key: key); @override @@ -352,4 +281,69 @@ class _AddSelectedProcedureState extends State { ), ); } + + postProcedure( + {ProcedureViewModel model, + String remarks, + String orderType, + PatiantInformtion patient, + List entityList, + ProcedureType procedureType}) async { + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); + controls.add( + Controls( + code: "remarks", + controlValue: element.remarks != null ? element.remarks : ""), + ); + controls.add( + Controls(code: "ordertype", controlValue: procedureType == + ProcedureType.PROCEDURE ? element.type ?? "1" : "0"), + ); + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); + + postProcedureReqModel.procedures = controlsProcedure; + await model.valadteProcedure(procedureValadteRequestModel); + if (model.state == ViewState.Idle) { + if (model.valadteProcedureList[0].entityList.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + Helpers.showErrorToast( + model.valadteProcedureList[0].entityList[0].warringMessages); + } + } + } else { + Helpers.showErrorToast(model.error); + } + } + } diff --git a/lib/screens/procedures/add_lab_home_screen.dart b/lib/screens/procedures/add_lab_home_screen.dart deleted file mode 100644 index d86c4ecd..00000000 --- a/lib/screens/procedures/add_lab_home_screen.dart +++ /dev/null @@ -1,218 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-favourite-procedure.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'add_lab_orders.dart'; - -class AddLabHomeScreen extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; - const AddLabHomeScreen({Key key, this.model, this.patient}) : super(key: key); - @override - _AddLabHomeScreenState createState() => - _AddLabHomeScreenState(patient: patient, model: model); -} - -class _AddLabHomeScreenState extends State - with SingleTickerProviderStateMixin { - _AddLabHomeScreenState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - TabController _tabController; - int _activeTab = 0; - - @override - void initState() { - super.initState(); - _tabController = TabController(length: 2, vsync: this); - _tabController.addListener(_handleTabSelection); - } - - @override - void dispose() { - super.dispose(); - _tabController.dispose(); - } - - _handleTabSelection() { - setState(() { - _activeTab = _tabController.index; - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - 'Add Procedure', - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.04, - ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), - child: Container( - height: - MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget( - screenSize, - _activeTab == 0, - "Favorite Templates", - ), - tabWidget( - screenSize, - _activeTab == 1, - 'All Lab', - ), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AddFavouriteProcedure( - patient: patient, - model: model, - addButtonTitle: TranslationBase.of(context).addLabOrder, - toolbarTitle: TranslationBase.of(context).applyForNewLabOrder, - categoryID: "02", - ), - AddSelectedLabOrder( - model: model, - patient: patient, - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ), - ); - }), - ), - ), - ); - } - - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { - return Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - if (counter != -1) - Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : Color(0xFFD02127), - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : Color(0xFFD02127), - fontWeight: FontWeight.w700, - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/screens/procedures/add_radiology_screen.dart b/lib/screens/procedures/add_radiology_screen.dart deleted file mode 100644 index 26308553..00000000 --- a/lib/screens/procedures/add_radiology_screen.dart +++ /dev/null @@ -1,219 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-favourite-procedure.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'add_lab_orders.dart'; -import 'add_radiology_order.dart'; - -class AddRadiologyScreen extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; - const AddRadiologyScreen({Key key, this.model, this.patient}) : super(key: key); - @override - _AddRadiologyScreenState createState() => - _AddRadiologyScreenState(patient: patient, model: model); -} - -class _AddRadiologyScreenState extends State - with SingleTickerProviderStateMixin { - _AddRadiologyScreenState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - TabController _tabController; - int _activeTab = 0; - - @override - void initState() { - super.initState(); - _tabController = TabController(length: 2, vsync: this); - _tabController.addListener(_handleTabSelection); - } - - @override - void dispose() { - super.dispose(); - _tabController.dispose(); - } - - _handleTabSelection() { - setState(() { - _activeTab = _tabController.index; - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).addRadiologyOrder, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.04, - ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), - child: Container( - height: - MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget( - screenSize, - _activeTab == 0, - "Favorite Templates", - ), - tabWidget( - screenSize, - _activeTab == 1, - 'All Radiology', - ), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AddFavouriteProcedure( - patient: patient, - model: model, - addButtonTitle: TranslationBase.of(context).addRadiologyOrder, - toolbarTitle: TranslationBase.of(context).addRadiologyOrder, - categoryID: "03", - ), - AddSelectedRadiologyOrder( - model: model, - patient: patient, - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ), - ); - }), - ), - ), - ); - } - - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { - return Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - if (counter != -1) - Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : Color(0xFFD02127), - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : Color(0xFFD02127), - fontWeight: FontWeight.w700, - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/screens/procedures/add_procedure_homeScreen.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart similarity index 60% rename from lib/screens/procedures/add_procedure_homeScreen.dart rename to lib/screens/procedures/base_add_procedure_tab_page.dart index 39ed4b25..4d25de2b 100644 --- a/lib/screens/procedures/add_procedure_homeScreen.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -2,30 +2,41 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-favourite-procedure.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class AddProcedureHome extends StatefulWidget { +import 'ProcedureType.dart'; +import 'add-favourite-procedure.dart'; +import 'add-procedure-form.dart'; +import 'add_lab_orders.dart'; +import 'add_radiology_order.dart'; + +class BaseAddProcedureTabPage extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddProcedureHome({Key key, this.model, this.patient}) : super(key: key); + final ProcedureType procedureType; + + const BaseAddProcedureTabPage( + {Key key, this.model, this.patient, this.procedureType}) + : super(key: key); + @override - _AddProcedureHomeState createState() => - _AddProcedureHomeState(patient: patient, model: model); + _BaseAddProcedureTabPageState createState() => + _BaseAddProcedureTabPageState(patient: patient, model: model, procedureType: procedureType); } -class _AddProcedureHomeState extends State +class _BaseAddProcedureTabPageState extends State with SingleTickerProviderStateMixin { - _AddProcedureHomeState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; + final ProcedureViewModel model; + final PatiantInformtion patient; + final ProcedureType procedureType; + + _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); + TabController _tabController; int _activeTab = 0; @@ -50,11 +61,9 @@ class _AddProcedureHomeState extends State @override Widget build(BuildContext context) { - //final routeArgs = ModalRoute.of(context).settings.arguments as Map; - //PatiantInformtion patient = routeArgs['patient']; final screenSize = MediaQuery.of(context).size; + return BaseView( - //onModelReady: (model) => model.getCategory(), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -77,7 +86,13 @@ class _AddProcedureHomeState extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - 'Add Procedure', + procedureType == ProcedureType.PROCEDURE + ? TranslationBase.of(context).addProcedures + : procedureType == ProcedureType.RADIOLOGY + ? TranslationBase.of(context) + .addRadiologyOrder + : TranslationBase.of(context) + .addLabOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -125,12 +140,21 @@ class _AddProcedureHomeState extends State tabWidget( screenSize, _activeTab == 0, - "Favorite Templates", + TranslationBase.of(context) + .favoriteTemplates, ), tabWidget( screenSize, _activeTab == 1, - 'All Procedures', + procedureType == ProcedureType.PROCEDURE + ? TranslationBase.of(context) + .allProcedures + : procedureType == + ProcedureType.RADIOLOGY + ? TranslationBase.of(context) + .allRadiology + : TranslationBase.of(context) + .allLab, ), ], ), @@ -147,13 +171,49 @@ class _AddProcedureHomeState extends State AddFavouriteProcedure( patient: patient, model: model, - addButtonTitle: TranslationBase.of(context).addSelectedProcedures, - toolbarTitle: 'Add Procedure', - ), - AddSelectedProcedure( - model: model, - patient: patient, + addButtonTitle: procedureType == + ProcedureType.PROCEDURE + ? TranslationBase.of(context) + .addProcedures + : procedureType == + ProcedureType.RADIOLOGY + ? TranslationBase.of(context) + .addRadiologyOrder + : TranslationBase.of(context) + .addLabOrder, + toolbarTitle: procedureType == + ProcedureType.PROCEDURE + ? TranslationBase.of(context) + .addProcedures + : procedureType == + ProcedureType.RADIOLOGY + ? TranslationBase.of(context) + .addRadiologyOrder + : TranslationBase.of(context) + .addLabOrder, + categoryID: procedureType == + ProcedureType.PROCEDURE + ? null + : procedureType == + ProcedureType.RADIOLOGY + ? "03" + : "02", ), + procedureType == ProcedureType.PROCEDURE + ? AddSelectedProcedure( + model: model, + patient: patient, + ) + : procedureType == + ProcedureType.RADIOLOGY + ? AddSelectedRadiologyOrder( + model: model, + patient: patient, + ) + : AddSelectedLabOrder( + model: model, + patient: patient, + ), ], ), ), @@ -177,7 +237,7 @@ class _AddProcedureHomeState extends State child: Container( height: screenSize.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -216,3 +276,5 @@ class _AddProcedureHomeState extends State ); } } + + diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index f6752c4a..756a19a0 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -15,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'ProcedureCard.dart'; +import 'ProcedureType.dart'; +import 'base_add_procedure_tab_page.dart'; class ProcedureScreen extends StatelessWidget { int doctorNameP; @@ -107,10 +108,12 @@ class ProcedureScreen extends StatelessWidget { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddProcedureHome( - patient: patient, - model: model, - )), + builder: (context) => BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.PROCEDURE, + ), + ), ); }, child: Container( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 9ed00146..78041705 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1035,6 +1035,8 @@ class TranslationBase { String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; + String get addProcedures => + localizedValues['addProcedures'][locale.languageCode]; String get updateProcedure => localizedValues['updateProcedure'][locale.languageCode]; @@ -1355,6 +1357,10 @@ class TranslationBase { String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode]; String get onHold => localizedValues['onHold'][locale.languageCode]; String get verified => localizedValues['verified'][locale.languageCode]; + String get favoriteTemplates => localizedValues['favoriteTemplates'][locale.languageCode]; + String get allProcedures => localizedValues['allProcedures'][locale.languageCode]; + String get allRadiology => localizedValues['allRadiology'][locale.languageCode]; + String get allLab => localizedValues['allLab'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 49afc338d674bcf4628d819392acc13aad189088 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 1 Jun 2021 10:47:58 +0300 Subject: [PATCH 014/124] 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 015/124] 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 016/124] 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 bc48d915c67e428ed7bbf06cd60cd6bbd2e69a42 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 1 Jun 2021 15:19:06 +0300 Subject: [PATCH 017/124] procedure refactoring --- lib/config/config.dart | 4 +- lib/core/viewModel/procedure_View_model.dart | 83 ++++- lib/screens/procedures/ProcedureType.dart | 78 +++- .../procedures/add-procedure-form.dart | 349 ------------------ .../procedures/add-procedure-page.dart | 265 +++++++++++++ lib/screens/procedures/add_lab_orders.dart | 269 -------------- .../procedures/add_radiology_order.dart | 270 -------------- .../base_add_procedure_tab_page.dart | 85 +---- .../procedures/procedure_checkout_screen.dart | 5 +- 9 files changed, 442 insertions(+), 966 deletions(-) delete mode 100644 lib/screens/procedures/add-procedure-form.dart create mode 100644 lib/screens/procedures/add-procedure-page.dart delete mode 100644 lib/screens/procedures/add_lab_orders.dart delete mode 100644 lib/screens/procedures/add_radiology_order.dart 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/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index ad62158e..68937c1c 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; +import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; @@ -19,8 +19,12 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/r 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'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:flutter/cupertino.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' + as cpe; class ProcedureViewModel extends BaseViewModel { //TODO Hussam clean it @@ -84,11 +88,15 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { + Future getProcedureCategory( + {String categoryName, String categoryID, patientId}) async { + if (categoryName == null) return; hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureCategory( - categoryName: categoryName, categoryID: categoryID,patientId: patientId); + categoryName: categoryName, + categoryID: categoryID, + patientId: patientId); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -137,8 +145,7 @@ class ProcedureViewModel extends BaseViewModel { templateName: element.templateName, templateId: element.templateID, template: element); - if(!templateList.contains(template)) - templateList.add(template); + if (!templateList.contains(template)) templateList.add(template); } }); print(templateList.length.toString()); @@ -357,4 +364,70 @@ class ProcedureViewModel extends BaseViewModel { } else DrAppToastMsg.showSuccesToast(mes); } + + Future preparePostProcedure( + {String remarks, + String orderType, + PatiantInformtion patient, + List entityList, + ProcedureType procedureType}) async { + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); + controls.add( + Controls( + code: "remarks", + controlValue: element.remarks != null ? element.remarks : ""), + ); + controls.add( + Controls( + code: "ordertype", + controlValue: procedureType == ProcedureType.PROCEDURE + ? element.type ?? "1" + : "0"), + ); + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); + + postProcedureReqModel.procedures = controlsProcedure; + await valadteProcedure(procedureValadteRequestModel); + if (state == ViewState.Idle) { + if (valadteProcedureList[0].entityList.length == 0) { + await postProcedure(postProcedureReqModel, patient.patientMRN); + + if (state == ViewState.ErrorLocal) { + Helpers.showErrorToast(error); + getProcedure(mrn: patient.patientMRN); + } else if (state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (state == ViewState.ErrorLocal) { + Helpers.showErrorToast(error); + getProcedure(mrn: patient.patientMRN); + } else if (state == ViewState.Idle) { + Helpers.showErrorToast( + valadteProcedureList[0].entityList[0].warringMessages); + } + } + } else { + Helpers.showErrorToast(error); + } + } } diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index e05fb7e1..4fc7781a 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -1,5 +1,81 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + enum ProcedureType { PROCEDURE, LAB_RESULT, RADIOLOGY, -} \ No newline at end of file +} + +extension procedureType on ProcedureType { + + String getFavouriteTabName(BuildContext context) { + return TranslationBase.of(context).favoriteTemplates; + } + + String getAllLabelName(BuildContext context) { + switch (this) { + case ProcedureType.PROCEDURE: + return TranslationBase.of(context).allProcedures; + case ProcedureType.LAB_RESULT: + return TranslationBase.of(context).allLab; + case ProcedureType.RADIOLOGY: + return TranslationBase.of(context).allRadiology; + default: + return ""; + } + } + + String getToolbarLabel(BuildContext context) { + switch (this) { + case ProcedureType.PROCEDURE: + return TranslationBase.of(context).addProcedures; + case ProcedureType.LAB_RESULT: + return TranslationBase.of(context).addRadiologyOrder; + case ProcedureType.RADIOLOGY: + return TranslationBase.of(context).addLabOrder; + default: + return ""; + } + } + + String getAddButtonTitle(BuildContext context) { + switch (this) { + case ProcedureType.PROCEDURE: + return TranslationBase.of(context).addProcedures; + case ProcedureType.LAB_RESULT: + return TranslationBase.of(context).addRadiologyOrder; + case ProcedureType.RADIOLOGY: + return TranslationBase.of(context).addLabOrder; + default: + return ""; + } + } + + String getCategoryId() { + switch (this) { + case ProcedureType.PROCEDURE: + return null; + case ProcedureType.LAB_RESULT: + return "02"; + case ProcedureType.RADIOLOGY: + return "03"; + default: + return null; + } + } + + String getCategoryName() { + switch (this) { + case ProcedureType.PROCEDURE: + return null; + case ProcedureType.LAB_RESULT: + return "Laboratory"; + case ProcedureType.RADIOLOGY: + return "Radiology"; + default: + return null; + } + } + +} diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart deleted file mode 100644 index ba2ec3de..00000000 --- a/lib/screens/procedures/add-procedure-form.dart +++ /dev/null @@ -1,349 +0,0 @@ -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/procedure/ControlsModel.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_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/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:flutter/material.dart'; - -import 'ProcedureType.dart'; -import 'entity_list_checkbox_search_widget.dart'; - -void addSelectedProcedure( - context, ProcedureViewModel model, PatiantInformtion patient) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return AddSelectedProcedure( - model: model, - patient: patient, - ); - }); -} - -class AddSelectedProcedure extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; - final ProcedureType procedureType; - - const AddSelectedProcedure({Key key, this.model, this.patient, this.procedureType}) - : super(key: key); - - @override - _AddSelectedProcedureState createState() => - _AddSelectedProcedureState(patient: patient, model: model); -} - -class _AddSelectedProcedureState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - - _AddSelectedProcedureState({this.patient, this.model}); - - TextEditingController procedureController = TextEditingController(); - TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); - TextEditingController procedureName = TextEditingController(); - - dynamic selectedCategory; - - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - @override - Widget build(BuildContext context) { - return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - body: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - Expanded( - child: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: (BuildContext context, - ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ]), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.04, - ), - Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * - 0.79, - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, - isTextFieldHasSuffix: false, - - maxLines: 1, - minLines: 1, - hasBorder: true, - controller: procedureName, - // onSubmitted: (_) { - // model.getProcedureCategory( - // categoryName: procedureName.text); - // }, - onClick: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, - categoryName: - procedureName.text); - else - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, - ); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, - ), - Expanded( - child: InkWell( - onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, - categoryName: procedureName.text); - else - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, - ); - }, - child: Icon( - Icons.search, - size: 25.0, - ), - ), - ), - ], - ), - if (procedureName.text.isNotEmpty && - model.procedureList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget - .model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - )), - SizedBox( - height: 115.0, - ), - ], - ), - ), - ), - ); - }), - ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).addSelectedProcedures, - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, - ); - return; - } - - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], - ), - ), - ], - ), - ), - ); - } - - bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); - if (history.length > 0) { - return true; - } - return false; - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList, - ProcedureType procedureType}) async { - PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient.patientMRN; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - - List controlsProcedure = List(); - - postProcedureReqModel.appointmentNo = patient.appointmentNo; - postProcedureReqModel.episodeID = patient.episodeNo; - postProcedureReqModel.patientMRN = patient.patientMRN; - - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); - controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), - ); - controls.add( - Controls(code: "ordertype", controlValue: procedureType == - ProcedureType.PROCEDURE ? element.type ?? "1" : "0"), - ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); - }); - - postProcedureReqModel.procedures = controlsProcedure; - await model.valadteProcedure(procedureValadteRequestModel); - if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { - await model.postProcedure(postProcedureReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('procedure has been added'); - } - } else { - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); - } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); - } - } - } else { - Helpers.showErrorToast(model.error); - } - } - -} diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart new file mode 100644 index 00000000..65f0b2e1 --- /dev/null +++ b/lib/screens/procedures/add-procedure-page.dart @@ -0,0 +1,265 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; + +import 'ProcedureType.dart'; +import 'entity_list_checkbox_search_widget.dart'; + +class AddProcedurePage extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + final ProcedureType procedureType; + + const AddProcedurePage( + {Key key, this.model, this.patient, this.procedureType}) + : super(key: key); + + @override + _AddProcedurePageState createState() => _AddProcedurePageState( + patient: patient, model: model, procedureType: this.procedureType); +} + +class _AddProcedurePageState extends State { + int selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + ProcedureType procedureType; + + _AddProcedurePageState({this.patient, this.model, this.procedureType}); + + TextEditingController procedureController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); + List entityList = List(); + List entityListProcedure = List(); + TextEditingController procedureName = TextEditingController(); + + dynamic selectedCategory; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getProcedureCategory( + categoryName: procedureType.getCategoryName(), + categoryID: procedureType.getCategoryId(), + patientId: patient.patientId); + }, + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( + isShowAppBar: false, + body: Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + Expanded( + child: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + // height: MediaQuery.of(context).size.height * 1.2, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (procedureType == ProcedureType.PROCEDURE) + Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * 0.02, + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * + 0.79, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchProcedureHere, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + // onClick: () { + // if (procedureName.text.isNotEmpty && + // procedureName.text.length >= 3) + // model.getProcedureCategory( + // patientId: patient.patientId, + // categoryName: + // procedureName.text); + // else + // DrAppToastMsg.showErrorToast( + // TranslationBase.of(context) + // .atLeastThreeCharacters, + // ); + // }, + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * + 0.02, + ), + Expanded( + child: InkWell( + onTap: () { + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + patientId: patient.patientId, + categoryName: + procedureName.text); + else + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); + }, + child: Icon( + Icons.search, + size: 25.0, + ), + ), + ), + ], + ), + ], + ), + if (procedureName.text.isNotEmpty && + model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + )), + ], + ), + ), + ), + ), + ), + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: procedureType.getAddButtonTitle(context), + fontWeight: FontWeight.w700, + color: Color(0xff359846), + onPressed: () async { + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); + return; + } + + Navigator.pop(context); + await model.preparePostProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ), + ), + ); + } + + bool isEntityListSelected(EntityList masterKey) { + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } +} diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart deleted file mode 100644 index b8d4e7c7..00000000 --- a/lib/screens/procedures/add_lab_orders.dart +++ /dev/null @@ -1,269 +0,0 @@ -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/procedure/ControlsModel.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_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/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:flutter/material.dart'; - -import 'entity_list_checkbox_search_widget.dart'; - -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); - - procedureValadteRequestModel.patientMRN = patient.appointmentNo; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; -} - -postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { - PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient.patientMRN; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - - List controlsProcedure = List(); - - postProcedureReqModel.appointmentNo = patient.appointmentNo; - - postProcedureReqModel.episodeID = patient.episodeNo; - postProcedureReqModel.patientMRN = patient.patientMRN; - - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); - controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), - ); - controls.add( - Controls(code: "ordertype", controlValue: "0"), - ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); - }); - - postProcedureReqModel.procedures = controlsProcedure; - await model.valadteProcedure(procedureValadteRequestModel); - if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { - await model.postProcedure(postProcedureReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getLabs(patient); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('procedure has been added'); - } - } else { - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getLabs(patient); - } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); - } - } - } else { - Helpers.showErrorToast(model.error); - } -} - -void addSelectedLabOrder( - context, ProcedureViewModel model, PatiantInformtion patient) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return AddSelectedLabOrder( - model: model, - patient: patient, - ); - }); -} - -class AddSelectedLabOrder extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; - - const AddSelectedLabOrder({Key key, this.model, this.patient}) - : super(key: key); - @override - _AddSelectedLabOrderState createState() => - _AddSelectedLabOrderState(patient: patient, model: model); -} - -class _AddSelectedLabOrderState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - _AddSelectedLabOrderState({this.patient, this.model}); - TextEditingController procedureController = TextEditingController(); - TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); - - dynamic selectedCategory; - - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - onModelReady: (model) => model.getProcedureCategory( - categoryName: "Laboratory", categoryID: "02",patientId: patient.patientId), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * .90, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10.0, - ), - if (widget.model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - )), - ], - ), - ), - ), - ); - }), - ), - bottomSheet: Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).addLabOrder, - fontWeight: FontWeight.w700, - color: Color(0xff359846), - onPressed: () { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, - ); - return; - } - - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], - ), - ), - ), - ); - } - - bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); - if (history.length > 0) { - return true; - } - return false; - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } -} diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart deleted file mode 100644 index dc68aacc..00000000 --- a/lib/screens/procedures/add_radiology_order.dart +++ /dev/null @@ -1,270 +0,0 @@ -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/procedure/ControlsModel.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_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/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:flutter/material.dart'; - -import 'entity_list_checkbox_search_widget.dart'; - -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); - - procedureValadteRequestModel.patientMRN = patient.appointmentNo; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; -} - -postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { - PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient.patientMRN; - procedureValadteRequestModel.episodeID = patient.episodeNo; - procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - - List controlsProcedure = List(); - - postProcedureReqModel.appointmentNo = patient.appointmentNo; - - postProcedureReqModel.episodeID = patient.episodeNo; - postProcedureReqModel.patientMRN = patient.patientMRN; - - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); - controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), - ); - controls.add( - Controls(code: "ordertype", controlValue: "0"), - ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); - }); - - postProcedureReqModel.procedures = controlsProcedure; - await model.valadteProcedure(procedureValadteRequestModel); - if (model.state == ViewState.Idle) { - if (model.valadteProcedureList[0].entityList.length == 0) { - await model.postProcedure(postProcedureReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getPatientRadOrders(patient); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('procedure has been added'); - } - } else { - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - model.getPatientRadOrders(patient); - } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); - } - } - } else { - Helpers.showErrorToast(model.error); - } -} - -void addSelectedRadiologyOrder( - context, ProcedureViewModel model, PatiantInformtion patient) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return AddSelectedRadiologyOrder( - model: model, - patient: patient, - ); - }); -} - -class AddSelectedRadiologyOrder extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; - - const AddSelectedRadiologyOrder({Key key, this.model, this.patient}) - : super(key: key); - - @override - _AddSelectedRadiologyOrderState createState() => - _AddSelectedRadiologyOrderState(patient: patient, model: model); -} - -class _AddSelectedRadiologyOrderState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - - _AddSelectedRadiologyOrderState({this.patient, this.model}); - - TextEditingController procedureController = TextEditingController(); - TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); - - dynamic selectedCategory; - - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - onModelReady: (model) => model.getProcedureCategory( - categoryName: "Radiology", categoryID: "03",patientId: patient.patientId), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10.0, - ), - if (widget.model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - )), - ], - ), - ), - ), - ); - }), - ), - bottomSheet: Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).addRadiologyOrder, - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context) - .fillTheMandatoryProcedureDetails); - return; - } - - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], - ), - ), - ), - ); - } - - bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); - if (history.length > 0) { - return true; - } - return false; - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } -} diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 4d25de2b..f4a6c85e 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -11,9 +11,7 @@ import 'package:flutter/material.dart'; import 'ProcedureType.dart'; import 'add-favourite-procedure.dart'; -import 'add-procedure-form.dart'; -import 'add_lab_orders.dart'; -import 'add_radiology_order.dart'; +import 'add-procedure-page.dart'; class BaseAddProcedureTabPage extends StatefulWidget { final ProcedureViewModel model; @@ -25,8 +23,8 @@ class BaseAddProcedureTabPage extends StatefulWidget { : super(key: key); @override - _BaseAddProcedureTabPageState createState() => - _BaseAddProcedureTabPageState(patient: patient, model: model, procedureType: procedureType); + _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( + patient: patient, model: model, procedureType: procedureType); } class _BaseAddProcedureTabPageState extends State @@ -86,13 +84,7 @@ class _BaseAddProcedureTabPageState extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - procedureType == ProcedureType.PROCEDURE - ? TranslationBase.of(context).addProcedures - : procedureType == ProcedureType.RADIOLOGY - ? TranslationBase.of(context) - .addRadiologyOrder - : TranslationBase.of(context) - .addLabOrder, + procedureType.getToolbarLabel(context), fontWeight: FontWeight.w700, fontSize: 20, ), @@ -140,21 +132,13 @@ class _BaseAddProcedureTabPageState extends State tabWidget( screenSize, _activeTab == 0, - TranslationBase.of(context) - .favoriteTemplates, + procedureType + .getFavouriteTabName(context), ), tabWidget( screenSize, _activeTab == 1, - procedureType == ProcedureType.PROCEDURE - ? TranslationBase.of(context) - .allProcedures - : procedureType == - ProcedureType.RADIOLOGY - ? TranslationBase.of(context) - .allRadiology - : TranslationBase.of(context) - .allLab, + procedureType.getAllLabelName(context), ), ], ), @@ -171,49 +155,18 @@ class _BaseAddProcedureTabPageState extends State AddFavouriteProcedure( patient: patient, model: model, - addButtonTitle: procedureType == - ProcedureType.PROCEDURE - ? TranslationBase.of(context) - .addProcedures - : procedureType == - ProcedureType.RADIOLOGY - ? TranslationBase.of(context) - .addRadiologyOrder - : TranslationBase.of(context) - .addLabOrder, - toolbarTitle: procedureType == - ProcedureType.PROCEDURE - ? TranslationBase.of(context) - .addProcedures - : procedureType == - ProcedureType.RADIOLOGY - ? TranslationBase.of(context) - .addRadiologyOrder - : TranslationBase.of(context) - .addLabOrder, - categoryID: procedureType == - ProcedureType.PROCEDURE - ? null - : procedureType == - ProcedureType.RADIOLOGY - ? "03" - : "02", + addButtonTitle: procedureType + .getAddButtonTitle(context), + toolbarTitle: procedureType + .getToolbarLabel(context), + categoryID: + procedureType.getCategoryId(), + ), + AddProcedurePage( + model: model, + patient: patient, + procedureType: procedureType, ), - procedureType == ProcedureType.PROCEDURE - ? AddSelectedProcedure( - model: model, - patient: patient, - ) - : procedureType == - ProcedureType.RADIOLOGY - ? AddSelectedRadiologyOrder( - model: model, - patient: patient, - ) - : AddSelectedLabOrder( - model: model, - patient: patient, - ), ], ), ), @@ -276,5 +229,3 @@ class _BaseAddProcedureTabPageState extends State ); } } - - diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index 76d6cf6f..4c054fc5 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_template_detai import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; +import 'package:doctor_app_flutter/screens/procedures/add-procedure-page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -223,10 +223,9 @@ class _ProcedureCheckOutScreenState extends State { ); }); Navigator.pop(context); - await postProcedure( + await model.preparePostProcedure( entityList: entityList, patient: widget.patient, - model: widget.model, remarks: remarksController.text); Navigator.pop(context); Navigator.pop(context); From 3107950f5c13eb804347874998e6b10f74f188f4 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 1 Jun 2021 17:00:24 +0300 Subject: [PATCH 018/124] fix bug --- lib/screens/procedures/ProcedureType.dart | 8 +- .../procedures/add-procedure-page.dart | 145 +++++++++--------- 2 files changed, 76 insertions(+), 77 deletions(-) diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 4fc7781a..44ac0a9d 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -31,9 +31,9 @@ extension procedureType on ProcedureType { case ProcedureType.PROCEDURE: return TranslationBase.of(context).addProcedures; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addRadiologyOrder; - case ProcedureType.RADIOLOGY: return TranslationBase.of(context).addLabOrder; + case ProcedureType.RADIOLOGY: + return TranslationBase.of(context).addRadiologyOrder; default: return ""; } @@ -44,9 +44,9 @@ extension procedureType on ProcedureType { case ProcedureType.PROCEDURE: return TranslationBase.of(context).addProcedures; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addRadiologyOrder; - case ProcedureType.RADIOLOGY: return TranslationBase.of(context).addLabOrder; + case ProcedureType.RADIOLOGY: + return TranslationBase.of(context).addRadiologyOrder; default: return ""; } diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index 65f0b2e1..3640a8dc 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -81,80 +81,79 @@ class _AddProcedurePageState extends State { children: [ if (procedureType == ProcedureType.PROCEDURE) Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * 0.02, + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * + 0.79, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchProcedureHere, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + // onClick: () { + // if (procedureName.text.isNotEmpty && + // procedureName.text.length >= 3) + // model.getProcedureCategory( + // patientId: patient.patientId, + // categoryName: + // procedureName.text); + // else + // DrAppToastMsg.showErrorToast( + // TranslationBase.of(context) + // .atLeastThreeCharacters, + // ); + // }, ), - ], - ), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.02, - ), - Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * - 0.79, - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - hasBorder: true, - controller: procedureName, - // onClick: () { - // if (procedureName.text.isNotEmpty && - // procedureName.text.length >= 3) - // model.getProcedureCategory( - // patientId: patient.patientId, - // categoryName: - // procedureName.text); - // else - // DrAppToastMsg.showErrorToast( - // TranslationBase.of(context) - // .atLeastThreeCharacters, - // ); - // }, + ), + SizedBox( + width: MediaQuery.of(context).size.width * + 0.02, + ), + Expanded( + child: InkWell( + onTap: () { + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + patientId: patient.patientId, + categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); + }, + child: Icon( + Icons.search, + size: 25.0, ), ), - SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, - ), - Expanded( - child: InkWell( - onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, - categoryName: - procedureName.text); - else - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, - ); - }, - child: Icon( - Icons.search, - size: 25.0, - ), - ), - ), - ], - ), - ], - ), + ), + ], + ), + ], + ), if (procedureName.text.isNotEmpty && model.categoriesList.length != 0) NetworkBaseView( @@ -205,12 +204,12 @@ class _AddProcedurePageState extends State { return; } - Navigator.pop(context); - await model.preparePostProcedure( + await this.model.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, remarks: remarksController.text); + Navigator.pop(context); }, ), ], From 4a9748739ec9a6bb754cec772e70797f1b74b6f2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 11:25:31 +0300 Subject: [PATCH 019/124] 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 4af94e6b715022e77aa7312a975bb3ae8d593851 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 2 Jun 2021 13:04:38 +0300 Subject: [PATCH 020/124] hot fix --- .../refer-patient-screen-in-patient.dart | 209 +-- .../prescription/add_prescription_form.dart | 35 +- .../prescription_checkout_screen.dart | 36 +- .../prescription/prescription_screen.dart | 1176 +++++++---------- 4 files changed, 605 insertions(+), 851 deletions(-) diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index cc491cf2..658ad895 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -25,12 +25,10 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class PatientMakeInPatientReferralScreen extends StatefulWidget { @override - _PatientMakeInPatientReferralScreenState createState() => - _PatientMakeInPatientReferralScreenState(); + _PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState(); } -class _PatientMakeInPatientReferralScreenState - extends State { +class _PatientMakeInPatientReferralScreenState extends State { PatiantInformtion patient; List referToList; dynamic _referTo; @@ -68,8 +66,7 @@ class _PatientMakeInPatientReferralScreenState onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -113,8 +110,7 @@ class _PatientMakeInPatientReferralScreenState } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -127,14 +123,8 @@ class _PatientMakeInPatientReferralScreenState String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; referToList = List(); - dynamic sameBranch = { - "id": 1, - "name": TranslationBase.of(context).sameBranch - }; - dynamic otherBranch = { - "id": 2, - "name": TranslationBase.of(context).otherBranch - }; + dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; + dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; referToList.add(sameBranch); referToList.add(otherBranch); @@ -188,8 +178,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).branch, - dropDownText: - _referTo != null ? _referTo['name'] : null, + dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: branchError, @@ -206,23 +195,15 @@ class _PatientMakeInPatientReferralScreenState _selectedBranch = null; _selectedClinic = null; _selectedDoctor = null; - model - .getDoctorBranch() - .then((value) async { + model.getDoctorBranch().then((value) async { _selectedBranch = value; if (_referTo['id'] == 1) { - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getClinics(_selectedBranch[ - 'facilityId']) - .then((_) => - GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + .getClinics(_selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } } else { _selectedBranch = null; @@ -247,9 +228,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).hospital, - dropDownText: _selectedBranch != null - ? _selectedBranch['facilityName'] - : null, + dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: hospitalError, @@ -268,17 +247,12 @@ class _PatientMakeInPatientReferralScreenState _selectedBranch = selectedValue; _selectedClinic = null; _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getClinics( - _selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + .getClinics(_selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } }); }, @@ -299,9 +273,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).clinic, - dropDownText: _selectedClinic != null - ? _selectedClinic['ClinicDescription'] - : null, + dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: clinicError, @@ -314,27 +286,19 @@ class _PatientMakeInPatientReferralScreenState attributeName: 'ClinicDescription', attributeValueId: 'ClinicID', usingSearch: true, - hintSearchText: - TranslationBase.of(context) - .clinicSearch, + hintSearchText: TranslationBase.of(context).clinicSearch, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() async { _selectedDoctor = null; _selectedClinic = selectedValue; - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model .getClinicDoctors( - patient, - _selectedClinic['ClinicID'], - _selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } }); }, @@ -355,49 +319,41 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, - dropDownText: _selectedDoctor != null - ? _selectedDoctor['Name'] - : null, + dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: doctorError, - onClick: _selectedClinic != null && - model.doctorsList != null && - model.doctorsList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.doctorsList, - attributeName: 'Name', - attributeValueId: 'DoctorID', - usingSearch: true, - hintSearchText: - TranslationBase.of(context) - .doctorSearch, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); + onClick: + _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'Name', + attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: TranslationBase.of(context).doctorSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : () { + if (_selectedClinic == null) { + DrAppToastMsg.showErrorToast("You need to select a clinic first"); + } else if (model.doctorsList == null || model.doctorsList.length == 0) { + DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); + } }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : () { - if (_selectedClinic == null) { - DrAppToastMsg.showErrorToast( - "You need to select a clinic first"); - } else if (model.doctorsList == null || - model.doctorsList.length == 0) { - DrAppToastMsg.showErrorToast( - "There is no doctors for this clinic"); - } - }, ), SizedBox( height: 10, @@ -425,11 +381,8 @@ class _PatientMakeInPatientReferralScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).referralFrequency, - dropDownText: _selectedFrequency != null - ? _selectedFrequency['Description'] - : null, + hintText: TranslationBase.of(context).referralFrequency, + dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: frequencyError, @@ -439,8 +392,7 @@ class _PatientMakeInPatientReferralScreenState attributeName: 'Description', attributeValueId: 'ParameterCode', usingSearch: true, - hintSearchText: TranslationBase.of(context) - .selectReferralFrequency, + hintSearchText: TranslationBase.of(context).selectReferralFrequency, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { @@ -478,8 +430,7 @@ class _PatientMakeInPatientReferralScreenState maxLines: 6, ), Positioned( - top: - 0, //MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( @@ -488,8 +439,7 @@ class _PatientMakeInPatientReferralScreenState size: 35, ), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ), @@ -524,32 +474,27 @@ class _PatientMakeInPatientReferralScreenState onPressed: () async { setState(() { if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; + branchError = TranslationBase.of(context).fieldRequired; } else { branchError = null; } if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; + hospitalError = TranslationBase.of(context).fieldRequired; } else { hospitalError = null; } if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context).fieldRequired; } else { clinicError = null; } if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context).fieldRequired; } else { doctorError = null; } if (_selectedFrequency == null) { - frequencyError = - TranslationBase.of(context).fieldRequired; + frequencyError = TranslationBase.of(context).fieldRequired; } else { frequencyError = null; } @@ -566,8 +511,7 @@ class _PatientMakeInPatientReferralScreenState projectID: _selectedBranch['facilityId'], clinicID: _selectedClinic['ClinicID'], doctorID: _selectedDoctor['DoctorID'], - frequencyCode: - _selectedFrequency['ParameterCode'], + frequencyCode: _selectedFrequency['ParameterCode'], ext: _extController.text, remarks: _remarksController.text, priority: _activePriority, @@ -575,9 +519,7 @@ class _PatientMakeInPatientReferralScreenState if (model.state == ViewState.ErrorLocal) DrAppToastMsg.showErrorToast(model.error); else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .referralSuccessMsg); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); } } @@ -602,8 +544,7 @@ class _PatientMakeInPatientReferralScreenState ]; return Container( height: screenSize.height * 0.070, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + decoration: containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -615,16 +556,13 @@ class _PatientMakeInPatientReferralScreenState child: Container( height: screenSize.height * 0.070, decoration: containerBorderDecoration( - _isActive ? Color(0XFFB8382B) : Colors.white, - _isActive ? Color(0XFFB8382B) : Colors.white), + _isActive ? Color(0XFFB8382B) : Colors.white, _isActive ? Color(0XFFB8382B) : Colors.white), child: Center( child: Text( item, style: TextStyle( fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, + color: _isActive ? Colors.white : Colors.black, //Colors.black, fontWeight: FontWeight.bold, ), ), @@ -664,8 +602,7 @@ class _PatientMakeInPatientReferralScreenState return time; } - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f4761897..a6e4ac10 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -147,8 +147,16 @@ class _PrescriptionFormWidgetState extends State { @override void initState() { - super.initState(); + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); selectedType = 1; + super.initState(); } setSelectedType(int val) { @@ -195,7 +203,7 @@ class _PrescriptionFormWidgetState extends State { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - indicationController.text += reconizedWord + '\n'; + instructionController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); @@ -263,25 +271,6 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: 60, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).newPrescriptionOrder, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ], - ), ], ), SizedBox( @@ -635,9 +624,7 @@ class _PrescriptionFormWidgetState extends State { size: 35, ), onPressed: () { - setState(() { - initSpeechState().then((value) => {onVoiceText()}); - }); + initSpeechState().then((value) => {onVoiceText()}); }, ), ), diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 27905b2d..5ebc84aa 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -136,8 +136,16 @@ class _PrescriptionCheckOutScreenState extends State @override void initState() { - super.initState(); + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); selectedType = 1; + super.initState(); } onVoiceText() async { @@ -512,29 +520,7 @@ class _PrescriptionCheckOutScreenState extends State }, ), SizedBox(height: spaceBetweenTextFileds), - // Container( - // color: Colors.white, - // child: AppTextFieldCustom( - // hintText: "UOM", - // isTextFieldHasSuffix: false, - // dropDownText: uom != null ? uom : null, - // enabled: false, - // ), - // ), SizedBox(height: spaceBetweenTextFileds), - // Container( - // color: Colors.white, - // child: AppTextFieldCustom( - // hintText: TranslationBase.of(context).boxQuantity, - // isTextFieldHasSuffix: false, - // dropDownText: box != null - // ? TranslationBase.of(context).boxQuantity + - // ": " + - // model.boxQuintity.toString() - // : null, - // enabled: false, - // ), - // ), SizedBox(height: spaceBetweenTextFileds), Container( decoration: BoxDecoration( @@ -559,9 +545,7 @@ class _PrescriptionCheckOutScreenState extends State size: 35, ), onPressed: () { - setState(() { - initSpeechState().then((value) => {onVoiceText()}); - }); + initSpeechState().then((value) => {onVoiceText()}); }, ), ), diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 6608f108..d5a94c61 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -18,7 +18,6 @@ class NewPrescriptionScreen extends StatefulWidget { class _NewPrescriptionScreenState extends State { PersistentBottomSheetController _controller; - final _scaffoldKey = GlobalKey(); TextEditingController strengthController = TextEditingController(); int testNum = 0; int strengthChar; @@ -35,694 +34,541 @@ class _NewPrescriptionScreenState extends State { patient = routeArgs['patient']; return BaseView( onModelReady: (model) => model.getPrescription(mrn: patient.patientId), - builder: - (BuildContext context, PrescriptionViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: Column( - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.prescriptionList.length != 0) - ? SizedBox( - height: - model.prescriptionList[0].rowcount == 0 - ? 200.0 - : 10.0) - : SizedBox(height: 200.0), - //model.prescriptionList == null - (model.prescriptionList.length != 0) - ? model.prescriptionList[0].rowcount == 0 - ? Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - addPrescriptionForm( - context, - model, - patient, - model.prescriptionList); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: - Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, + builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescription, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + color: Colors.white, + child: Column( + children: [ + PatientPageHeaderWidget(patient), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.prescriptionList.length != 0) + ? SizedBox(height: model.prescriptionList[0].rowcount == 0 ? 200.0 : 10.0) + : SizedBox(height: 200.0), + //model.prescriptionList == null + (model.prescriptionList.length != 0) + ? model.prescriptionList[0].rowcount == 0 + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addPrescriptionForm(context, model, patient, model.prescriptionList); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noPrescriptionListed, + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + : Padding( + padding: EdgeInsets.all(14.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + InkWell( + child: Container( + height: 50.0, + width: 450.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10.0), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + ' Add more medication', + fontWeight: FontWeight.w100, + fontSize: 12.5, ), - ), + Icon( + Icons.add, + color: Color(0XFFB8382C), + ) + ], ), ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context) - .noPrescriptionListed, - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context) - .addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, - ), - ], - ), - ], - ) - : Padding( - padding: EdgeInsets.all(14.0), - child: NetworkBaseView( - baseViewModel: model, + ), + onTap: () { + addPrescriptionForm(context, model, patient, model.prescriptionList); + //model.postPrescription(); + }, + ), + SizedBox( + height: 10.0, + ), + ...List.generate( + model.prescriptionList[0].rowcount, + (index) => Container( + color: Colors.white, child: Column( - mainAxisAlignment: - MainAxisAlignment.start, children: [ - InkWell( - child: Container( - height: 50.0, - width: 450.0, - decoration: BoxDecoration( + SizedBox( + height: MediaQuery.of(context).size.height * 0.022, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: + // CrossAxisAlignment.start, + children: [ + Container( color: Colors.white, - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular( - 10.0), - ), - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, + height: MediaQuery.of(context).size.height * 0.21, + width: MediaQuery.of(context).size.width * 0.1, + child: Column( children: [ AppText( - ' Add more medication', - fontWeight: - FontWeight.w100, - fontSize: 12.5, + (DateTime.parse(model.prescriptionList[0].entityList[index] + .createdOn) != + null + ? (DateTime.parse(model.prescriptionList[0] + .entityList[index].createdOn) + .year) + .toString() + : DateTime.now().year) + .toString(), + color: Colors.green, + fontSize: 13.5, + ), + AppText( + AppDateUtils.getMonth(model.prescriptionList[0] + .entityList[index].createdOn != + null + ? (DateTime.parse(model.prescriptionList[0] + .entityList[index].createdOn) + .month) + : DateTime.now().month) + .toUpperCase(), + color: Colors.green, + ), + AppText( + DateTime.parse( + model.prescriptionList[0].entityList[index].createdOn) + .day + .toString(), + color: Colors.green, + ), + AppText( + AppDateUtils.getTimeFormated(DateTime.parse(model + .prescriptionList[0].entityList[index].createdOn)) + .toString(), + color: Colors.green, ), - Icon( - Icons.add, - color: - Color(0XFFB8382C), - ) ], ), ), - ), - onTap: () { - addPrescriptionForm( - context, - model, - patient, - model.prescriptionList); - //model.postPrescription(); - }, - ), - SizedBox( - height: 10.0, - ), - ...List.generate( - model.prescriptionList[0] - .rowcount, - (index) => Container( - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.022, - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - // crossAxisAlignment: - // CrossAxisAlignment.start, - children: [ - Container( - color: Colors.white, - height: MediaQuery.of( - context) - .size - .height * - 0.21, - width: MediaQuery.of( - context) - .size - .width * - 0.1, - child: Column( - children: [ - AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) - .toString() - : DateTime.now() - .year) - .toString(), - color: Colors - .green, - fontSize: - 13.5, - ), - AppText( - AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) - .month) - : DateTime.now() - .month) - .toUpperCase(), - color: Colors - .green, - ), - AppText( - DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn) - .day - .toString(), - color: Colors - .green, - ), - AppText( - AppDateUtils.getTimeFormated(DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn)) - .toString(), - color: Colors - .green, - ), - ], + Container( + color: Colors.white, + // height: MediaQuery.of( + // context) + // .size + // .height * + // 0.3499, + width: MediaQuery.of(context).size.width * 0.77, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Start Date:', + fontWeight: FontWeight.w700, + fontSize: 14.0, ), - ), - Container( - color: Colors.white, - // height: MediaQuery.of( - // context) - // .size - // .height * - // 0.3499, - width: MediaQuery.of( - context) - .size - .width * - 0.77, - child: Column( - children: [ - Row( - children: [ - AppText( - 'Start Date:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - AppDateUtils.getDateFormatted(DateTime.parse(model - .prescriptionList[0] - .entityList[index] - .startDate)), - fontSize: - 13.5, - ), - ), - SizedBox( - width: - 6.0, - ), - AppText( - 'Order Type:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .orderTypeDescription, - fontSize: - 13.0, - ), - ), - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Container( - color: Colors - .white, - child: - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .medicationName, - fontWeight: - FontWeight.w700, - fontSize: - 15.0, - ), - ), - ) - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doseDetail, - fontSize: - 15.0, - ), - ) - ], - ), - SizedBox( - height: 10.0, - ), - Row( - children: [ - AppText( - 'Indication: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].indication), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'UOM: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].uom), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'BOX Quantity: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'pharmacy Intervention ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), - ), - ), - ], - ), - SizedBox( - height: - 5.0), - Row( - children: [ - AppText( - 'pharmacist Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - Expanded( - child: AppText( - // commening below code because there is an error coming in the model please fix it before pushing it - model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, - fontSize: 15.0), - ) - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .doctorName + - ": ", - fontWeight: - FontWeight - .w600, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doctorName, - fontWeight: - FontWeight.w700, - ), - ) - ], - ), - SizedBox( - height: 8.0, - ), - Row( - children: [ - AppText( - 'Doctor Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - Expanded( - child: - Container( - color: Colors - .white, - // height: MediaQuery.of(context).size.height * - // 0.038, - child: - RichText( - // maxLines: - // 2, - // overflow: - // TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 10.0), - text: - TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].remarks != null - ? model.prescriptionList[0].entityList[index].remarks - : "", - ), - ), - ), - ), - ], - ), - SizedBox( - height: 10.0, + Expanded( + child: AppText( + AppDateUtils.getDateFormatted(DateTime.parse(model + .prescriptionList[0].entityList[index].startDate)), + fontSize: 13.5, + ), + ), + SizedBox( + width: 6.0, + ), + AppText( + 'Order Type:', + fontWeight: FontWeight.w700, + fontSize: 14.0, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList[index] + .orderTypeDescription, + fontSize: 13.0, + ), + ), + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Container( + color: Colors.white, + child: Expanded( + child: AppText( + model.prescriptionList[0].entityList[index] + .medicationName, + fontWeight: FontWeight.w700, + fontSize: 15.0, ), - - // SizedBox( - // height: 40, - // ), - ], + ), + ) + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Expanded( + child: AppText( + model.prescriptionList[0].entityList[index].doseDetail, + fontSize: 15.0, + ), + ) + ], + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + AppText( + 'Indication: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index] + .indication), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'UOM: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model + .prescriptionList[0].entityList[index].uom), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'BOX Quantity: ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index] + .quantity + .toString() == + null + ? "" + : model.prescriptionList[0].entityList[index] + .quantity + .toString()), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'pharmacy Intervention ', + fontWeight: FontWeight.w700, + fontSize: 17.0, + ), + Expanded( + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 12.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index] + .pharmacyInervention == + null + ? "" + : model.prescriptionList[0].entityList[index] + .pharmacyInervention + .toString()), + ), + ), + ], + ), + SizedBox(height: 5.0), + Row( + children: [ + AppText( + 'pharmacist Remarks : ', + fontWeight: FontWeight.w700, + fontSize: 15.0, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList[index] + .pharmacistRemarks == + null + ? "" + : model.prescriptionList[0].entityList[index] + .pharmacistRemarks, + fontSize: 15.0), + ) + ], + ), + SizedBox( + height: 20.0, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).doctorName + ": ", + fontWeight: FontWeight.w600, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList[index].doctorName, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + SizedBox( + height: 8.0, + ), + Row( + children: [ + AppText( + 'Doctor Remarks : ', + fontWeight: FontWeight.w700, + fontSize: 13.0, ), - ), - Container( - color: Colors.white, - height: MediaQuery.of( - context) - .size - .height * - 0.16, - width: MediaQuery.of( - context) - .size - .width * - 0.06, - child: Column( - children: [ - InkWell( - child: Icon( - Icons - .edit), - onTap: () { - updatePrescriptionForm( - box: model - .prescriptionList[ - 0] - .entityList[ - index] - .quantity, - uom: model - .prescriptionList[ - 0] - .entityList[ - index] - .uom, - drugNameGeneric: model - .prescriptionList[ - 0] - .entityList[ - index] - .medicationName, - doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID - .toString(), - doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity - .toString(), - duration: - model.prescriptionList[0].entityList[index].doseDurationDays - .toString(), - startDate: - model.prescriptionList[0].entityList[index].startDate - .toString(), - dose: model - .prescriptionList[ - 0] - .entityList[ - index] - .doseTimingID - .toString(), - frequency: - model.prescriptionList[0].entityList[index].frequencyID - .toString(), - rouat: model - .prescriptionList[0] - .entityList[index] - .routeID - .toString(), - patient: patient, - drugId: model.prescriptionList[0].entityList[index].medicineCode, - drugName: model.prescriptionList[0].entityList[index].medicationName, - remarks: model.prescriptionList[0].entityList[index].remarks, - model: model, - enteredRemarks: model.prescriptionList[0].entityList[index].remarks, - context: context); - //model.postPrescription(); - }, + Expanded( + child: Container( + color: Colors.white, + // height: MediaQuery.of(context).size.height * + // 0.038, + child: RichText( + // maxLines: + // 2, + // overflow: + // TextOverflow.ellipsis, + strutStyle: StrutStyle(fontSize: 10.0), + text: TextSpan( + style: TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index] + .remarks != + null + ? model.prescriptionList[0].entityList[index] + .remarks + : "", + ), ), - ], + ), ), - ), - ], - ), - Divider( - height: 0, - thickness: 1.0, - color: Colors.grey, - ), - ], + ], + ), + SizedBox( + height: 10.0, + ), + + // SizedBox( + // height: 40, + // ), + ], + ), ), - ), + Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.16, + width: MediaQuery.of(context).size.width * 0.06, + child: Column( + children: [ + InkWell( + child: Icon(Icons.edit), + onTap: () { + updatePrescriptionForm( + box: model + .prescriptionList[0].entityList[index].quantity, + uom: model.prescriptionList[0].entityList[index].uom, + drugNameGeneric: model.prescriptionList[0] + .entityList[index].medicationName, + doseUnit: model.prescriptionList[0].entityList[index] + .doseDailyUnitID + .toString(), + doseStreangth: model.prescriptionList[0] + .entityList[index].doseDailyQuantity + .toString(), + duration: model.prescriptionList[0].entityList[index] + .doseDurationDays + .toString(), + startDate: model + .prescriptionList[0].entityList[index].startDate + .toString(), + dose: model.prescriptionList[0].entityList[index].doseTimingID + .toString(), + frequency: model + .prescriptionList[0].entityList[index].frequencyID + .toString(), + rouat: model.prescriptionList[0].entityList[index].routeID + .toString(), + patient: patient, + drugId: model.prescriptionList[0].entityList[index].medicineCode, + drugName: model.prescriptionList[0].entityList[index].medicationName, + remarks: model.prescriptionList[0].entityList[index].remarks, + model: model, + enteredRemarks: model.prescriptionList[0].entityList[index].remarks, + context: context); + //model.postPrescription(); + }, + ), + ], + ), + ), + ], + ), + Divider( + height: 0, + thickness: 1.0, + color: Colors.grey, ), ], ), ), - ) - : Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - addPrescriptionForm(context, model, - patient, model.prescriptionList); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context) - .noPrescriptionListed, - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, - ), - ], ), ], - ) - ], - ), - ), - ), - )), + ), + ), + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addPrescriptionForm(context, model, patient, model.prescriptionList); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noPrescriptionListed, + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + ], + ), + ), + ), + )), ); } From 01abd02d19f2701b6474ecebfaf8f6e86a178d68 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 14:55:32 +0300 Subject: [PATCH 021/124] 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 91cd7f2b88d030fe46c9b421ba1b642b19f38a19 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 2 Jun 2021 15:10:07 +0300 Subject: [PATCH 022/124] refactoring --- .../procedures/add-favourite-procedure.dart | 58 +++--- .../procedures/add-procedure-page.dart | 167 +++++++---------- .../base_add_procedure_tab_page.dart | 11 +- .../procedures/entity_list_fav_procedure.dart | 2 +- .../entity_list_procedure_widget.dart | 168 ------------------ 5 files changed, 93 insertions(+), 313 deletions(-) delete mode 100644 lib/screens/procedures/entity_list_procedure_widget.dart diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index a68336c7..66118508 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -13,20 +13,19 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'ProcedureType.dart'; + class AddFavouriteProcedure extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - final String categoryID; - final String addButtonTitle; - final String toolbarTitle; + final ProcedureType procedureType; - AddFavouriteProcedure( - {Key key, - this.model, - this.patient, - this.categoryID, - @required this.addButtonTitle, - @required this.toolbarTitle}); + AddFavouriteProcedure({ + Key key, + this.model, + this.patient, + @required this.procedureType, + }); @override _AddFavouriteProcedureState createState() => _AddFavouriteProcedureState(); @@ -43,7 +42,7 @@ class _AddFavouriteProcedureState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => - model.getProcedureTemplate(categoryID: widget.categoryID), + model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -55,23 +54,20 @@ class _AddFavouriteProcedureState extends State { ), if (model.templateList.length != 0) Expanded( - child: NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchFavProceduresWidget( - model: model, - removeFavProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addFavProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - isEntityFavListSelected: (master) => - isEntityListSelected(master), - ), + child: EntityListCheckboxSearchFavProceduresWidget( + model: model, + removeFavProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addFavProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + isEntityFavListSelected: (master) => + isEntityListSelected(master), ), ), Container( @@ -80,7 +76,7 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.addButtonTitle ?? + title: widget.procedureType.getAddButtonTitle(context) ?? TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, @@ -100,8 +96,8 @@ class _AddFavouriteProcedureState extends State { items: entityList, model: model, patient: widget.patient, - addButtonTitle: widget.addButtonTitle, - toolbarTitle: widget.toolbarTitle, + addButtonTitle: widget.procedureType.getAddButtonTitle(context), + toolbarTitle: widget.procedureType.getToolbarLabel(context), ), ), ); diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index 3640a8dc..e0b7374f 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -21,7 +21,7 @@ class AddProcedurePage extends StatefulWidget { final ProcedureType procedureType; const AddProcedurePage( - {Key key, this.model, this.patient, this.procedureType}) + {Key key, this.model, this.patient, @required this.procedureType}) : super(key: key); @override @@ -73,7 +73,6 @@ class _AddProcedurePageState extends State { baseViewModel: model, child: SingleChildScrollView( child: Container( - // height: MediaQuery.of(context).size.height * 1.2, child: Padding( padding: EdgeInsets.all(12.0), child: Column( @@ -81,80 +80,70 @@ class _AddProcedurePageState extends State { children: [ if (procedureType == ProcedureType.PROCEDURE) Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ], - ), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.02, - ), - Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * - 0.79, - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - hasBorder: true, - controller: procedureName, - // onClick: () { - // if (procedureName.text.isNotEmpty && - // procedureName.text.length >= 3) - // model.getProcedureCategory( - // patientId: patient.patientId, - // categoryName: - // procedureName.text); - // else - // DrAppToastMsg.showErrorToast( - // TranslationBase.of(context) - // .atLeastThreeCharacters, - // ); - // }, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, - ), - Expanded( - child: InkWell( - onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, - categoryName: procedureName.text); - else - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, - ); - }, - child: Icon( - Icons.search, - size: 25.0, + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * 0.02, + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * + 0.79, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchProcedureHere, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, ), ), - ), - ], - ), - ], - ), - if (procedureName.text.isNotEmpty && + SizedBox( + width: MediaQuery.of(context).size.width * + 0.02, + ), + Expanded( + child: InkWell( + onTap: () { + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + patientId: patient.patientId, + categoryName: + procedureName.text); + else + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); + }, + child: Icon( + Icons.search, + size: 25.0, + ), + ), + ), + ], + ), + ], + ), + if ((procedureType == ProcedureType.PROCEDURE + ? procedureName.text.isNotEmpty + : true) && model.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, @@ -229,36 +218,4 @@ class _AddProcedurePageState extends State { } return false; } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } } diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index f4a6c85e..58efaaca 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -74,7 +74,7 @@ class _BaseAddProcedureTabPageState extends State builder: (BuildContext context, ScrollController scrollController) { return Container( - height: MediaQuery.of(context).size.height * 1.20, + height: MediaQuery.of(context).size.height * 1.25, child: Padding( padding: EdgeInsets.all(12.0), child: Column( @@ -153,14 +153,9 @@ class _BaseAddProcedureTabPageState extends State controller: _tabController, children: [ AddFavouriteProcedure( - patient: patient, model: model, - addButtonTitle: procedureType - .getAddButtonTitle(context), - toolbarTitle: procedureType - .getToolbarLabel(context), - categoryID: - procedureType.getCategoryId(), + patient: patient, + procedureType: procedureType, ), AddProcedurePage( model: model, diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 822726ce..4b946131 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -81,7 +81,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState NetworkBaseView( baseViewModel: widget.model, child: Container( - height: MediaQuery.of(context).size.height * 0.65, + height: MediaQuery.of(context).size.height * 0.60, child: Center( child: Container( margin: EdgeInsets.only(top: 15), diff --git a/lib/screens/procedures/entity_list_procedure_widget.dart b/lib/screens/procedures/entity_list_procedure_widget.dart deleted file mode 100644 index 125262e4..00000000 --- a/lib/screens/procedures/entity_list_procedure_widget.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.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:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ProcedureListWidget extends StatefulWidget { - final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(EntityList) removeHistory; - final Function(EntityList) addHistory; - final Function(EntityList) addRemarks; - - final bool Function(EntityList) isEntityListSelected; - final List masterList; - - ProcedureListWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isEntityListSelected, - this.addRemarks}) - : super(key: key); - - @override - _ProcedureListWidgetState createState() => _ProcedureListWidgetState(); -} - -class _ProcedureListWidgetState extends State { - int selectedType = 0; - int typeUrgent; - int typeRegular; - - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - List items = List(); - List remarksList = List(); - List typeList = List(); - - @override - void initState() { - items.addAll(widget.masterList); - super.initState(); - } - - TextEditingController remarksController = TextEditingController(); - @override - Widget build(BuildContext context) { - return Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: widget.model, - child: Container( - height: MediaQuery.of(context).size.height * 0.75, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - TextFields( - hintText: TranslationBase.of(context).searchProcedures, - suffixIcon: EvaIcons.search, - onChanged: (value) { - filterSearchResults(value); - }, - ), - SizedBox( - height: 15, - ), - items.length != 0 - ? Column( - children: items.map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: widget.isEntityListSelected( - historyInfo), - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget - .removeHistory(historyInfo); - } else { - widget.addHistory(historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: AppText( - historyInfo.procedureName, - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ) - : Center( - child: Container( - child: AppText( - "There's no procedures for this category", - color: Color(0xFFB9382C)), - ), - ) - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - ], - ), - ); - } - - void filterSearchResults(String query) { - List dummySearchList = List(); - dummySearchList.addAll(widget.masterList); - if (query.isNotEmpty) { - List dummyListData = List(); - dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { - dummyListData.add(item); - } - }); - setState(() { - items.clear(); - items.addAll(dummyListData); - }); - return; - } else { - setState(() { - items.clear(); - items.addAll(widget.masterList); - }); - } - } -} From 08e104ca56219bebabce05d105528f5f0b65eb18 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 16:05:37 +0300 Subject: [PATCH 023/124] 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 024/124] 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 025/124] 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 026/124] 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 b36ddf9317e9ef024fcbe1ff89ff35c601daf7b1 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 3 Jun 2021 15:25:16 +0300 Subject: [PATCH 027/124] add prescription to procedure type --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 8 +- .../add_favourite_prescription.dart | 17 +++-- .../prescription/prescriptions_page.dart | 75 +++++++++++++------ lib/screens/procedures/ProcedureType.dart | 13 +++- .../procedures/add-favourite-procedure.dart | 67 ++++++++++++----- .../base_add_procedure_tab_page.dart | 32 ++++++-- lib/util/translations_delegate_base.dart | 2 + 8 files changed, 154 insertions(+), 64 deletions(-) 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/config/localized_values.dart b/lib/config/localized_values.dart index 4d3c0e78..d1e67692 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1003,7 +1003,9 @@ const Map> localizedValues = { "verified": {"en": "Verified", "ar": "تم التحقق"}, "endCall": {"en": "End Call", "ar": "انهاء"}, "favoriteTemplates": {"en": "Favorite Templates", "ar": "القوالب المفضلة"}, - "allProcedures": {"en": "All Procedures", "ar": "كل الإجراءات"}, - "allRadiology": {"en": "All Radiology", "ar": "كل الأشعة"}, - "allLab": {"en": "All Lab", "ar": "كل المختبرات"}, + "allProcedures": {"en": "All Procedures", "ar": "جميع الإجراءات"}, + "allRadiology": {"en": "All Radiology", "ar": "جميع الأشعة"}, + "allLab": {"en": "All Lab", "ar": "جميع المختبرات"}, + "allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"}, + "addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"}, }; diff --git a/lib/screens/prescription/add_favourite_prescription.dart b/lib/screens/prescription/add_favourite_prescription.dart index 118df049..f9e175f6 100644 --- a/lib/screens/prescription/add_favourite_prescription.dart +++ b/lib/screens/prescription/add_favourite_prescription.dart @@ -18,7 +18,8 @@ class AddFavPrescription extends StatefulWidget { final PatiantInformtion patient; final String categoryID; - const AddFavPrescription({Key key, this.model, this.patient, this.categoryID}) : super(key: key); + const AddFavPrescription({Key key, this.model, this.patient, this.categoryID}) + : super(key: key); @override _AddFavPrescriptionState createState() => _AddFavPrescriptionState(); @@ -30,11 +31,14 @@ class _AddFavPrescriptionState extends State { List entityList = List(); ProcedureTempleteDetailsModel groupProcedures; + @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.categoryID), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + onModelReady: (model) => + model.getProcedureTemplate(categoryID: widget.categoryID), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( @@ -59,7 +63,8 @@ class _AddFavPrescriptionState extends State { entityList.add(history); }); }, - isEntityFavListSelected: (master) => isEntityListSelected(master), + isEntityFavListSelected: (master) => + isEntityListSelected(master), groupProcedures: groupProcedures, selectProcedures: (valasd) { setState(() { @@ -109,7 +114,9 @@ class _AddFavPrescriptionState extends State { bool isEntityListSelected(ProcedureTempleteDetailsModel masterKey) { Iterable history = entityList.where( - (element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName); + (element) => + masterKey.templateID == element.templateID && + masterKey.procedureName == element.procedureName); if (history.length > 0) { return true; } diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index b56befdb..dd02b57e 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da import 'package:doctor_app_flutter/screens/prescription/prescription_home_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; +import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; @@ -50,7 +52,8 @@ class PrescriptionsPage extends StatelessWidget { SizedBox( height: 12, ), - if (model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43) + if (model.prescriptionsList.isNotEmpty && + patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -70,7 +73,8 @@ class PrescriptionsPage extends StatelessWidget { ], ), ), - if (patient.patientStatusType != null && patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -90,20 +94,25 @@ class PrescriptionsPage extends StatelessWidget { ], ), ), - if ((patient.patientStatusType != null && patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => PrescriptionHomeScreen( + builder: (context) => + BaseAddProcedureTabPage( patient: patient, - model: model, + prescriptionModel: model, + procedureType: + ProcedureType.PRESCRIPTION, )), ); }, - label: TranslationBase.of(context).applyForNewPrescriptionsOrder, + label: TranslationBase.of(context) + .applyForNewPrescriptionsOrder, ), ...List.generate( model.prescriptionsList.length, @@ -112,7 +121,8 @@ class PrescriptionsPage extends StatelessWidget { context, FadePage( page: PrescriptionItemsPage( - prescriptions: model.prescriptionsList[index], + prescriptions: + model.prescriptionsList[index], patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -120,16 +130,22 @@ class PrescriptionsPage extends StatelessWidget { ), ), child: DoctorCard( - doctorName: model.prescriptionsList[index].doctorName, - profileUrl: model.prescriptionsList[index].doctorImageURL, + doctorName: + model.prescriptionsList[index].doctorName, + profileUrl: model + .prescriptionsList[index].doctorImageURL, branch: model.prescriptionsList[index].name, - clinic: model.prescriptionsList[index].clinicDescription, + clinic: model.prescriptionsList[index] + .clinicDescription, isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index].appointmentDate, + appointmentDate: + AppDateUtils.getDateTimeFromServerFormat( + model.prescriptionsList[index] + .appointmentDate, ), ))), - if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) + if (model.prescriptionsList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -140,7 +156,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noPrescriptionsFound), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), @@ -165,29 +182,38 @@ class PrescriptionsPage extends StatelessWidget { FadePage( page: PrescriptionItemsInPatientPage( prescriptionIndex: index, - prescriptions: model.inPatientPrescription[index], + prescriptions: model + .inPatientPrescription[index], patient: patient, patientType: patientType, arrivalType: arrivalType, - startOn: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].startDatetime, + startOn: AppDateUtils + .getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .startDatetime, ), - stopOn: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].stopDatetime, + stopOn: AppDateUtils + .getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .stopDatetime, ), ), ), ), child: InPatientDoctorCard( - doctorName: model.inPatientPrescription[index].itemDescription, + doctorName: model.inPatientPrescription[index] + .itemDescription, profileUrl: 'sss', branch: 'hamza', clinic: 'basheer', isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].prescriptionDatetime, + appointmentDate: + AppDateUtils.getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .prescriptionDatetime, ), - createdBy: model.inPatientPrescription[index].createdByName, + createdBy: model.inPatientPrescription[index] + .createdByName, ))), if (model.inPatientPrescription.length == 0) Center( @@ -200,7 +226,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noPrescriptionsFound), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 44ac0a9d..ad896a1f 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -5,10 +5,10 @@ enum ProcedureType { PROCEDURE, LAB_RESULT, RADIOLOGY, + PRESCRIPTION, } extension procedureType on ProcedureType { - String getFavouriteTabName(BuildContext context) { return TranslationBase.of(context).favoriteTemplates; } @@ -21,6 +21,8 @@ extension procedureType on ProcedureType { return TranslationBase.of(context).allLab; case ProcedureType.RADIOLOGY: return TranslationBase.of(context).allRadiology; + case ProcedureType.PRESCRIPTION: + return TranslationBase.of(context).allPrescription; default: return ""; } @@ -34,6 +36,8 @@ extension procedureType on ProcedureType { return TranslationBase.of(context).addLabOrder; case ProcedureType.RADIOLOGY: return TranslationBase.of(context).addRadiologyOrder; + case ProcedureType.PRESCRIPTION: + return TranslationBase.of(context).addPrescription; default: return ""; } @@ -47,6 +51,8 @@ extension procedureType on ProcedureType { return TranslationBase.of(context).addLabOrder; case ProcedureType.RADIOLOGY: return TranslationBase.of(context).addRadiologyOrder; + case ProcedureType.PRESCRIPTION: + return TranslationBase.of(context).addPrescription; default: return ""; } @@ -58,8 +64,8 @@ extension procedureType on ProcedureType { return null; case ProcedureType.LAB_RESULT: return "02"; - case ProcedureType.RADIOLOGY: - return "03"; + case ProcedureType.PRESCRIPTION: + return "55"; default: return null; } @@ -77,5 +83,4 @@ extension procedureType on ProcedureType { return null; } } - } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 66118508..ebbf9b5b 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -1,8 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_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/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_checkout_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -17,12 +19,14 @@ import 'ProcedureType.dart'; class AddFavouriteProcedure extends StatefulWidget { final ProcedureViewModel model; + final PrescriptionViewModel prescriptionModel; final PatiantInformtion patient; final ProcedureType procedureType; AddFavouriteProcedure({ Key key, this.model, + this.prescriptionModel, this.patient, @required this.procedureType, }); @@ -37,6 +41,7 @@ class _AddFavouriteProcedureState extends State { ProcedureViewModel model; PatiantInformtion patient; List entityList = List(); + ProcedureTempleteDetailsModel groupProcedures; @override Widget build(BuildContext context) { @@ -55,6 +60,7 @@ class _AddFavouriteProcedureState extends State { if (model.templateList.length != 0) Expanded( child: EntityListCheckboxSearchFavProceduresWidget( + isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), model: model, removeFavProcedure: (item) { setState(() { @@ -68,6 +74,12 @@ class _AddFavouriteProcedureState extends State { }, isEntityFavListSelected: (master) => isEntityListSelected(master), + groupProcedures: groupProcedures, + selectProcedures: (valasd) { + setState(() { + groupProcedures = valasd; + }); + }, ), ), Container( @@ -81,26 +93,45 @@ class _AddFavouriteProcedureState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, - ); - return; - } + if(widget.procedureType == ProcedureType.PRESCRIPTION){ + if (groupProcedures == null) { + DrAppToastMsg.showErrorToast( + 'Please Select item ', + ); + return; + } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ProcedureCheckOutScreen( - items: entityList, - model: model, - patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context), - toolbarTitle: widget.procedureType.getToolbarLabel(context), + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PrescriptionCheckOutScreen( + patient: widget.patient, + model: widget.prescriptionModel, + groupProcedures: groupProcedures, + ), ), - ), - ); + ); + } else { + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); + return; + } + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ProcedureCheckOutScreen( + items: entityList, + model: model, + patient: widget.patient, + addButtonTitle: widget.procedureType.getAddButtonTitle(context), + toolbarTitle: widget.procedureType.getToolbarLabel(context), + ), + ), + ); + } }, ), ], diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 58efaaca..e9ab695b 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.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/models/patient/patiant_info_model.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/screens/prescription/add_prescription_form.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/network_base_view.dart'; @@ -15,11 +16,16 @@ import 'add-procedure-page.dart'; class BaseAddProcedureTabPage extends StatefulWidget { final ProcedureViewModel model; + final PrescriptionViewModel prescriptionModel; final PatiantInformtion patient; final ProcedureType procedureType; const BaseAddProcedureTabPage( - {Key key, this.model, this.patient, this.procedureType}) + {Key key, + this.model, + this.prescriptionModel, + this.patient, + @required this.procedureType}) : super(key: key); @override @@ -153,15 +159,25 @@ class _BaseAddProcedureTabPageState extends State controller: _tabController, children: [ AddFavouriteProcedure( - model: model, - patient: patient, - procedureType: procedureType, - ), - AddProcedurePage( - model: model, + model: this.model, + prescriptionModel: + widget.prescriptionModel, patient: patient, procedureType: procedureType, ), + if (widget.procedureType == + ProcedureType.PRESCRIPTION) + PrescriptionFormWidget( + widget.prescriptionModel, + widget.patient, + widget.prescriptionModel + .prescriptionList) + else + AddProcedurePage( + model: this.model, + patient: patient, + procedureType: procedureType, + ), ], ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 78041705..16ae07bd 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1361,6 +1361,8 @@ class TranslationBase { String get allProcedures => localizedValues['allProcedures'][locale.languageCode]; String get allRadiology => localizedValues['allRadiology'][locale.languageCode]; String get allLab => localizedValues['allLab'][locale.languageCode]; + String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; + String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 259ea53319c8fb3125a1036d7b417eac72f55c5c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 3 Jun 2021 22:19:28 +0300 Subject: [PATCH 028/124] 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 66d12f8fddd56596ecdc0a3c76a2e3f8430235d0 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 6 Jun 2021 10:25:17 +0300 Subject: [PATCH 029/124] procedure fixes, liveCare working --- .../patient/LiveCarePatientServices.dart | 10 +- .../add_favourite_prescription.dart | 125 ----------- .../prescription_home_screen.dart | 203 ------------------ .../prescription/prescriptions_page.dart | 2 - lib/screens/procedures/ProcedureType.dart | 2 + .../procedures/add-favourite-procedure.dart | 4 +- .../entity_list_checkbox_search_widget.dart | 1 + 7 files changed, 11 insertions(+), 336 deletions(-) delete mode 100644 lib/screens/prescription/add_favourite_prescription.dart delete mode 100644 lib/screens/prescription/prescription_home_screen.dart diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 4fc25094..cbb596b6 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -13,6 +13,8 @@ class LiveCarePatientServices extends BaseService { bool _isFinished = false; + bool _isLive = false; + bool get isFinished => _isFinished; setFinished(bool isFinished){ @@ -53,7 +55,7 @@ class LiveCarePatientServices extends BaseService { hasError = true; super.error = error; - }, body: endCallReq.toJson(),isLiveCare: true); + }, body: endCallReq.toJson(),isLiveCare:_isLive); } Future startCall(StartCallReq startCallReq) async { @@ -64,7 +66,7 @@ class LiveCarePatientServices extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: startCallReq.toJson(),isLiveCare: true); + }, body: startCallReq.toJson(),isLiveCare:_isLive); } Future endCallWithCharge(int vcID) async{ hasError = false; @@ -79,7 +81,7 @@ class LiveCarePatientServices extends BaseService { }, body: { "VC_ID": vcID,"generalid":"Cs2020@2016\$2958", - },isLiveCare: true + },isLiveCare:_isLive ); } @@ -98,7 +100,7 @@ class LiveCarePatientServices extends BaseService { "VC_ID": vcID, "IsOutKsa": false, "Notes": notes, - },isLiveCare: true + },isLiveCare:_isLive ); } } \ No newline at end of file diff --git a/lib/screens/prescription/add_favourite_prescription.dart b/lib/screens/prescription/add_favourite_prescription.dart deleted file mode 100644 index f9e175f6..00000000 --- a/lib/screens/prescription/add_favourite_prescription.dart +++ /dev/null @@ -1,125 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/medicine_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/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart'; -import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:flutter/material.dart'; - -class AddFavPrescription extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - final String categoryID; - - const AddFavPrescription({Key key, this.model, this.patient, this.categoryID}) - : super(key: key); - - @override - _AddFavPrescriptionState createState() => _AddFavPrescriptionState(); -} - -class _AddFavPrescriptionState extends State { - MedicineViewModel model; - PatiantInformtion patient; - - List entityList = List(); - ProcedureTempleteDetailsModel groupProcedures; - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => - model.getProcedureTemplate(categoryID: widget.categoryID), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( - isShowAppBar: false, - baseViewModel: model, - body: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - if (model.templateList.length != 0) - Expanded( - child: NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchFavProceduresWidget( - isProcedure: false, - model: model, - removeFavProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addFavProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - isEntityFavListSelected: (master) => - isEntityListSelected(master), - groupProcedures: groupProcedures, - selectProcedures: (valasd) { - setState(() { - groupProcedures = valasd; - }); - }, - ), - ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'Add Selected Prescription', - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () { - if (groupProcedures == null) { - DrAppToastMsg.showErrorToast( - 'Please Select item ', - ); - return; - } - - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PrescriptionCheckOutScreen( - patient: widget.patient, - model: widget.model, - groupProcedures: groupProcedures, - ), - ), - ); - }, - ), - ], - ), - ), - ], - ), - ), - ); - } - - bool isEntityListSelected(ProcedureTempleteDetailsModel masterKey) { - Iterable history = entityList.where( - (element) => - masterKey.templateID == element.templateID && - masterKey.procedureName == element.procedureName); - if (history.length > 0) { - return true; - } - return false; - } -} diff --git a/lib/screens/prescription/prescription_home_screen.dart b/lib/screens/prescription/prescription_home_screen.dart deleted file mode 100644 index 6bdfabb1..00000000 --- a/lib/screens/prescription/prescription_home_screen.dart +++ /dev/null @@ -1,203 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.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/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/add_favourite_prescription.dart'; -import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.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/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/material.dart'; - -class PrescriptionHomeScreen extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - - const PrescriptionHomeScreen({Key key, this.model, this.patient}) : super(key: key); - @override - _PrescriptionHomeScreenState createState() => _PrescriptionHomeScreenState(); -} - -class _PrescriptionHomeScreenState extends State with SingleTickerProviderStateMixin { - PrescriptionViewModel model; - PatiantInformtion patient; - TabController _tabController; - int _activeTab = 0; - @override - void initState() { - super.initState(); - _tabController = TabController(length: 2, vsync: this); - _tabController.addListener(_handleTabSelection); - } - - @override - void dispose() { - super.dispose(); - _tabController.dispose(); - } - - _handleTabSelection() { - setState(() { - _activeTab = _tabController.index; - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - //onModelReady: (model) => model.getCategory(), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row(children: [ - InkWell( - child: Icon( - Icons.arrow_back_ios, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ), - SizedBox( - width: 7.0, - ), - AppText( - 'Add prescription', - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.04, - ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: - BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget( - screenSize, - _activeTab == 0, - "Favorite Templates", - ), - tabWidget( - screenSize, - _activeTab == 1, - 'All Prescription', - ), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AddFavPrescription( - model: widget.model, - patient: widget.patient, - categoryID: '55', - ), - PrescriptionFormWidget( - widget.model, widget.patient, widget.model.prescriptionList), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ), - ); - }), - ), - ), - ); - } - - Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { - return Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - if (counter != -1) - Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : Color(0xFFD02127), - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : Color(0xFFD02127), - fontWeight: FontWeight.w700, - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index dd02b57e..224d30e4 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -1,8 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_home_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index ad896a1f..28a72041 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -64,6 +64,8 @@ extension procedureType on ProcedureType { return null; case ProcedureType.LAB_RESULT: return "02"; + case ProcedureType.RADIOLOGY: + return "03"; case ProcedureType.PRESCRIPTION: return "55"; default: diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index ebbf9b5b..978fc2c5 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -75,9 +75,9 @@ class _AddFavouriteProcedureState extends State { isEntityFavListSelected: (master) => isEntityListSelected(master), groupProcedures: groupProcedures, - selectProcedures: (valasd) { + selectProcedures: (selectedProcedure) { setState(() { - groupProcedures = valasd; + groupProcedures = selectedProcedure; }); }, ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 801c730c..725bb007 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -19,6 +19,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final bool Function(EntityList) isEntityListSelected; final List masterList; + /// todo clear the function here EntityListCheckboxSearchWidget( {Key key, this.model, From d0173bd061fe37d82d31ba8d902a26bf5ced25c2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 11:32:41 +0300 Subject: [PATCH 030/124] 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 69892353343e69e0919949378e6f7cd968e5d06c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 6 Jun 2021 11:56:52 +0300 Subject: [PATCH 031/124] Live care Is Login service --- lib/config/config.dart | 6 +- .../live_care_login_reguest_model.dart | 27 ++++++ .../patient/LiveCarePatientServices.dart | 83 ++++++++++--------- .../prescription/add_prescription_form.dart | 4 +- 4 files changed, 75 insertions(+), 45 deletions(-) create mode 100644 lib/core/model/live_care/live_care_login_reguest_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index c8af8ad9..85815f7f 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"; @@ -217,6 +217,8 @@ 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"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/live_care/live_care_login_reguest_model.dart b/lib/core/model/live_care/live_care_login_reguest_model.dart new file mode 100644 index 00000000..e14d4223 --- /dev/null +++ b/lib/core/model/live_care/live_care_login_reguest_model.dart @@ -0,0 +1,27 @@ +class LiveCareUserLoginRequestModel { + String tokenID; + String generalid; + int doctorId; + int isOutKsa; + int isLogin; + + LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin}); + + LiveCareUserLoginRequestModel.fromJson(Map json) { + tokenID = json['TokenID']; + generalid = json['generalid']; + doctorId = json['DoctorId']; + isOutKsa = json['IsOutKsa']; + isLogin = json['IsLogin']; + } + + Map toJson() { + final Map data = new Map(); + data['TokenID'] = this.tokenID; + data['generalid'] = this.generalid; + data['DoctorId'] = this.doctorId; + data['IsOutKsa'] = this.isOutKsa; + data['IsLogin'] = this.isLogin; + return data; + } +} diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 4fc25094..33ad3637 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; @@ -15,18 +16,19 @@ class LiveCarePatientServices extends BaseService { bool get isFinished => _isFinished; - setFinished(bool isFinished){ + setFinished(bool isFinished) { _isFinished = isFinished; } - var endCallResponse = {}; var transferToAdminResponse = {}; + var isLoginResponse = {}; StartCallRes _startCallRes; StartCallRes get startCallRes => _startCallRes; - Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ + Future getPendingPatientERForDoctorApp( + PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async { hasError = false; await baseAppClient.post( GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, @@ -47,58 +49,57 @@ class LiveCarePatientServices extends BaseService { Future endCall(EndCallReq endCallReq) async { hasError = false; await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async { - endCallResponse = response; }, onFailure: (String error, int statusCode) { - hasError = true; super.error = error; - }, body: endCallReq.toJson(),isLiveCare: true); + }, body: endCallReq.toJson(), isLiveCare: true); } Future startCall(StartCallReq startCallReq) async { hasError = false; - await baseAppClient.post(START_LIVE_CARE_CALL, - onSuccess: (response, statusCode) async { - _startCallRes = StartCallRes.fromJson(response); + await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async { + _startCallRes = StartCallRes.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: startCallReq.toJson(),isLiveCare: true); + }, body: startCallReq.toJson(), isLiveCare: true); } - Future endCallWithCharge(int vcID) async{ + + Future endCallWithCharge(int vcID) async { hasError = false; - await baseAppClient.post( - END_CALL_WITH_CHARGE, - onSuccess: (dynamic response, int statusCode) { - endCallResponse = response; - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: { - "VC_ID": vcID,"generalid":"Cs2020@2016\$2958", - },isLiveCare: true - ); + await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) { + endCallResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + "generalid": "Cs2020@2016\$2958", + }, isLiveCare: true); } - Future transferToAdmin(int vcID, String notes) async{ + Future transferToAdmin(int vcID, String notes) async { hasError = false; - await baseAppClient.post( - TRANSFERT_TO_ADMIN, - onSuccess: (dynamic response, int statusCode) { - transferToAdminResponse = response; - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: { - "VC_ID": vcID, - "IsOutKsa": false, - "Notes": notes, - },isLiveCare: true - ); + await baseAppClient.post(TRANSFERT_TO_ADMIN, onSuccess: (dynamic response, int statusCode) { + transferToAdminResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + "IsOutKsa": false, + "Notes": notes, + }, isLiveCare: true); + } + + Future isLogin(LiveCareUserLoginRequestModel isLoginRequestModel) async { + hasError = false; + await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { + isLoginResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: isLoginRequestModel.toJson(), isLiveCare: true); } -} \ No newline at end of file +} diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a6e4ac10..6a3e5f5b 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -421,7 +421,7 @@ class _PrescriptionFormWidgetState extends State { width: 5.0, ), PrescriptionTextFiled( - width: MediaQuery.of(context).size.width * 0.560, + width: MediaQuery.of(context).size.width * 0.517, element: units, elementError: unitError, keyName: 'description', @@ -512,7 +512,7 @@ class _PrescriptionFormWidgetState extends State { ), ), Container( - width: MediaQuery.of(context).size.width * 0.65, + width: MediaQuery.of(context).size.width * 0.59, color: Colors.white, child: TextField( maxLines: 5, From c671b60097a3f2aae5c848460928314030b9b257 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 12:14:18 +0300 Subject: [PATCH 032/124] 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 033/124] 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 c800219428d8e813026edd7041048b34bba01f45 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 6 Jun 2021 16:58:42 +0300 Subject: [PATCH 034/124] Live Care Is Login Service --- .../patient/LiveCarePatientServices.dart | 8 +- .../viewModel/LiveCarePatientViewModel.dart | 46 +++--- .../live_care/live_care_patient_screen.dart | 132 +++++++++--------- pubspec.lock | 8 +- 4 files changed, 99 insertions(+), 95 deletions(-) diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index cf44cd68..d05f6dd9 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -55,7 +55,7 @@ class LiveCarePatientServices extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: endCallReq.toJson(), isLiveCare:_isLive); + }, body: endCallReq.toJson(), isLiveCare: _isLive); } Future startCall(StartCallReq startCallReq) async { @@ -65,7 +65,7 @@ class LiveCarePatientServices extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: startCallReq.toJson(), isLiveCare:_isLive); + }, body: startCallReq.toJson(), isLiveCare: _isLive); } Future endCallWithCharge(int vcID) async { @@ -95,13 +95,13 @@ class LiveCarePatientServices extends BaseService { }, isLiveCare: _isLive); } - Future isLogin(LiveCareUserLoginRequestModel isLoginRequestModel) async { + Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { hasError = false; await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: isLoginRequestModel.toJson(), isLiveCare: true); + }, body: isLoginRequestModel.toJson(), isLiveCare: _isLive); } } diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 844ebf55..b1b18672 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -1,6 +1,7 @@ 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/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; @@ -14,8 +15,7 @@ import '../../locator.dart'; class LiveCarePatientViewModel extends BaseViewModel { List filterData = []; - LiveCarePatientServices _liveCarePatientServices = - locator(); + LiveCarePatientServices _liveCarePatientServices = locator(); StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; @@ -28,12 +28,9 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); } - PendingPatientERForDoctorAppRequestModel - pendingPatientERForDoctorAppRequestModel = - PendingPatientERForDoctorAppRequestModel( - sErServiceID: _dashboardService.sServiceID, outSA: false); - await _liveCarePatientServices.getPendingPatientERForDoctorApp( - pendingPatientERForDoctorAppRequestModel); + PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = + PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false); + await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; @@ -120,16 +117,11 @@ class LiveCarePatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { - String fullName = - _liveCarePatientServices.patientList[i].fullName.toUpperCase(); - String patientID = - _liveCarePatientServices.patientList[i].patientId.toString(); - String mobile = - _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); - - if (fullName.contains(str.toUpperCase()) || - patientID.contains(str) || - mobile.contains(str)) { + String fullName = _liveCarePatientServices.patientList[i].fullName.toUpperCase(); + String patientID = _liveCarePatientServices.patientList[i].patientId.toString(); + String mobile = _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); + + if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) { filterData.add(_liveCarePatientServices.patientList[i]); } } @@ -139,4 +131,22 @@ class LiveCarePatientViewModel extends BaseViewModel { notifyListeners(); } } + + Future isLogin(int loginStatus) async { + await getDoctorProfile(isGetProfile: true); + + LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); + userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0; + userLoginRequestModel.isLogin = loginStatus; + userLoginRequestModel.generalid = "Cs2020@2016\$2958"; + + setState(ViewState.BusyLocal); + await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 43afd4c1..51757bf0 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -30,7 +30,7 @@ class _LiveCarePatientScreenState extends State { void initState() { super.initState(); timer = Timer.periodic(Duration(seconds: 10), (Timer t) { - if(_liveCareViewModel != null){ + if (_liveCareViewModel != null) { _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); } }); @@ -38,6 +38,7 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { + _liveCareViewModel.isLogin(0); _liveCareViewModel = null; timer?.cancel(); super.dispose(); @@ -49,7 +50,7 @@ class _LiveCarePatientScreenState extends State { onModelReady: (model) async { _liveCareViewModel = model; await model.getPendingPatientERForDoctorApp(); - + await model.isLogin(1); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -82,7 +83,9 @@ class _LiveCarePatientScreenState extends State { ]), ), ), - SizedBox(height: 20,), + SizedBox( + height: 20, + ), Center( child: FractionallySizedBox( widthFactor: .9, @@ -90,44 +93,35 @@ class _LiveCarePatientScreenState extends State { width: double.maxFinite, height: 75, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: Color(0xffCCCCCC), ), color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(left: 10, top: 10), + child: AppText( + TranslationBase.of(context).searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), ), ), model.state == ViewState.Idle @@ -136,44 +130,44 @@ class _LiveCarePatientScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient, ), ) : ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.filterData.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: PatientCard( - patientInfo: model.filterData[index], - patientType: "0", - arrivalType: "0", - isFromSearch: false, - isInpatient: false, - isFromLiveCare:true, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "0", - "isSearch": false, - "isInpatient": false, - "arrivalType": "0", - "isSearchAndOut": false, - "isFromLiveCare":true, - }); - }, - // isFromSearch: widget.isSearch, - ), - ); - })), - ) : Expanded( - child: AppLoaderWidget(containerColor: Colors.transparent,)), + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: "0", + arrivalType: "0", + isFromSearch: false, + isInpatient: false, + isFromLiveCare: true, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "0", + "isSearch": false, + "isInpatient": false, + "arrivalType": "0", + "isSearchAndOut": false, + "isFromLiveCare": true, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + })), + ) + : Expanded( + child: AppLoaderWidget( + containerColor: Colors.transparent, + )), ], ), ), diff --git a/pubspec.lock b/pubspec.lock index 49ff6372..25596d43 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -587,7 +587,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -629,7 +629,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -921,7 +921,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" 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" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From 5d0a7a4045742fb971876f4e7c9fb93c98165eba Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 6 Jun 2021 17:08:12 +0300 Subject: [PATCH 035/124] livecare changes --- lib/config/config.dart | 5 +- .../live_care/AlternativeServicesList.dart | 42 ++++++ .../patient/LiveCarePatientServices.dart | 94 +++++++----- .../viewModel/LiveCarePatientViewModel.dart | 63 ++++++++ lib/screens/home/home_screen.dart | 2 + lib/screens/live_care/TestScreen.dart | 136 ++++++++++++++++++ lib/screens/live_care/end_call_screen.dart | 1 + 7 files changed, 302 insertions(+), 41 deletions(-) create mode 100644 lib/core/model/live_care/AlternativeServicesList.dart create mode 100644 lib/screens/live_care/TestScreen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index c8af8ad9..41e3313d 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"; @@ -89,6 +89,7 @@ const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RES const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; +const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart new file mode 100644 index 00000000..fab11b71 --- /dev/null +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -0,0 +1,42 @@ +import 'package:flutter/material.dart'; + +class AlternativeService { + int serviceID; + String serviceName; + bool isSelected; + + AlternativeService( + {this.serviceID, this.serviceName, this.isSelected = false}); + + AlternativeService.fromJson(Map json) { + serviceID = json['ServicID']; + serviceName = json['ServiceName']; + } + + Map toJson() { + final Map data = new Map(); + data['ServicID'] = this.serviceID; + data['ServiceName'] = this.serviceName; + return data; + } +} + +class AlternativeServicesList with ChangeNotifier { + List _alternativeServicesList; + + getServicesList(){ + return _alternativeServicesList; + } + + setServicesList(List alternativeServicesList) { + this._alternativeServicesList = alternativeServicesList; + notifyListeners(); + } + + setSelected(AlternativeService service, bool isSelected) { + List alternativeService = _alternativeServicesList.where((element) => service.serviceID == element.serviceID).toList(); + + alternativeService[0].isSelected = isSelected; + notifyListeners(); + } +} diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index cbb596b6..05b73393 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -1,4 +1,7 @@ +import 'dart:collection'; + import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; @@ -11,24 +14,28 @@ class LiveCarePatientServices extends BaseService { List get patientList => _patientList; + List alternativeServicesList = []; + bool _isFinished = false; bool _isLive = false; bool get isFinished => _isFinished; - setFinished(bool isFinished){ + setFinished(bool isFinished) { _isFinished = isFinished; } - var endCallResponse = {}; var transferToAdminResponse = {}; StartCallRes _startCallRes; + StartCallRes get startCallRes => _startCallRes; - Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ + Future getPendingPatientERForDoctorApp( + PendingPatientERForDoctorAppRequestModel + pendingPatientERForDoctorAppRequestModel) async { hasError = false; await baseAppClient.post( GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, @@ -49,58 +56,67 @@ class LiveCarePatientServices extends BaseService { Future endCall(EndCallReq endCallReq) async { hasError = false; await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async { - endCallResponse = response; }, onFailure: (String error, int statusCode) { - hasError = true; super.error = error; - }, body: endCallReq.toJson(),isLiveCare:_isLive); + }, body: endCallReq.toJson(), isLiveCare: _isLive); } Future startCall(StartCallReq startCallReq) async { hasError = false; await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async { - _startCallRes = StartCallRes.fromJson(response); + _startCallRes = StartCallRes.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: startCallReq.toJson(),isLiveCare:_isLive); + }, body: startCallReq.toJson(), isLiveCare: _isLive); } - Future endCallWithCharge(int vcID) async{ + + Future endCallWithCharge(int vcID) async { hasError = false; - await baseAppClient.post( - END_CALL_WITH_CHARGE, - onSuccess: (dynamic response, int statusCode) { - endCallResponse = response; - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: { - "VC_ID": vcID,"generalid":"Cs2020@2016\$2958", - },isLiveCare:_isLive - ); + await baseAppClient.post(END_CALL_WITH_CHARGE, + onSuccess: (dynamic response, int statusCode) { + endCallResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + "generalid": "Cs2020@2016\$2958", + }, isLiveCare: _isLive); } - Future transferToAdmin(int vcID, String notes) async{ + Future transferToAdmin(int vcID, String notes) async { hasError = false; - await baseAppClient.post( - TRANSFERT_TO_ADMIN, - onSuccess: (dynamic response, int statusCode) { - transferToAdminResponse = response; - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: { - "VC_ID": vcID, - "IsOutKsa": false, - "Notes": notes, - },isLiveCare:_isLive - ); + await baseAppClient.post(TRANSFERT_TO_ADMIN, + onSuccess: (dynamic response, int statusCode) { + transferToAdminResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + "IsOutKsa": false, + "Notes": notes, + }, isLiveCare: _isLive); + } + + Future getAlternativeServices(int vcID) async { + hasError = false; + alternativeServicesList.clear(); + + await baseAppClient.post(GET_ALTERNATIVE_SERVICE, + onSuccess: (dynamic response, int statusCode) { + response['AlternativeServicesList'].forEach((v) { + alternativeServicesList.add(AlternativeService.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + }, isLiveCare: _isLive); } -} \ No newline at end of file +} diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 844ebf55..a64552aa 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -1,5 +1,6 @@ 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/model/live_care/AlternativeServicesList.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; @@ -19,6 +20,8 @@ class LiveCarePatientViewModel extends BaseViewModel { StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; + List get alternativeServicesList => _liveCarePatientServices.alternativeServicesList; + DashboardService _dashboardService = locator(); getPendingPatientERForDoctorApp({bool isFromTimer = false}) async { @@ -115,6 +118,17 @@ class LiveCarePatientViewModel extends BaseViewModel { } } + Future getAlternativeServices(int vcID) async { + setState(ViewState.BusyLocal); + await _liveCarePatientServices.getAlternativeServices(vcID); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { @@ -139,4 +153,53 @@ class LiveCarePatientViewModel extends BaseViewModel { notifyListeners(); } } + + // AlternativeServicesList demoServicesList = AlternativeServicesList(); + + setDemoData(){ + alternativeServicesList.clear(); + alternativeServicesList.add( + AlternativeService(serviceID: 1, serviceName: "Medicine Home Delivery"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 2, serviceName: "LABORATORY"), + ); + alternativeServicesList.add( + AlternativeService( + serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 5, serviceName: "ER SERVICES"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 6, serviceName: "PHYSIOTHERAPY"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 7, serviceName: "DRESSING"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 8, serviceName: "INJECTION"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"), + ); + alternativeServicesList.add( + AlternativeService( + serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"), + ); + alternativeServicesList.add( + AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), + ); + } + + setSelected(AlternativeService service, bool isSelected) { + int index = alternativeServicesList.indexOf(service); + if(index !=-1) + alternativeServicesList[index].isSelected = isSelected; + notifyListeners(); + } + } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c305b752..d079a477 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -13,6 +13,7 @@ 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'; import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; +import 'package:doctor_app_flutter/screens/live_care/TestScreen.dart'; import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; @@ -341,6 +342,7 @@ class _HomeScreenState extends State { context, FadePage( page: LiveCarePatientScreen(), + // page: TestScreen(), ), ); }, diff --git a/lib/screens/live_care/TestScreen.dart b/lib/screens/live_care/TestScreen.dart new file mode 100644 index 00000000..974f2351 --- /dev/null +++ b/lib/screens/live_care/TestScreen.dart @@ -0,0 +1,136 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; +import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.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/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:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class TestScreen extends StatefulWidget { + @override + _TestScreenState createState() => _TestScreenState(); +} + +class _TestScreenState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.setDemoData(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).patientProfile, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: false, + body: Container( + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: Colors.red[600], + title: "open dialog", //TranslationBase.of(context).close, + onPressed: () { + showAlternativesDialog(context, model, () { + model.alternativeServicesList.map((e) => () { + if (e.isSelected) { + print(e.serviceName); + } + }); + Navigator.of(context).pop(); + }); + }, + ), + ), + ), + ), + ); + } + + showAlternativesDialog(BuildContext context, LiveCarePatientViewModel model, Function okFunction) { + return showDialog( + context: context, + barrierDismissible: false, // user must tap button! + builder: (_) { + return Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AlertDialog( + title: null, + content: Container( + height: MediaQuery.of(context).size.height / 2, + child: CheckBoxListWidget(model: model,), + ), + actions: [ + AppButton( + onPressed: (){ + okFunction(); + }, + title: TranslationBase.of(context).noteConfirm, + fontColor: Colors.white, + color: Colors.green[600], + ), + AppButton( + onPressed: () { + Navigator.of(context).pop(); + }, + title: TranslationBase.of(context).cancel, + fontColor: Colors.white, + color: Colors.red[600], + ), + ], + ), + ], + ), + ); + }); + } +} + +class CheckBoxListWidget extends StatefulWidget { + final LiveCarePatientViewModel model; + const CheckBoxListWidget({ + Key key, this.model, + }) : super(key: key); + + @override + _CheckBoxListState createState() => _CheckBoxListState(); +} + +class _CheckBoxListState extends State { + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: [ + ...widget.model + .alternativeServicesList + .map( + (element) => Container( + child: CheckboxListTile( + title: AppText( + element.serviceName, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.2, + ), + value: element.isSelected, + onChanged: (newValue) { + setState(() { + widget.model.setSelected( + element, newValue); + }); + }, + activeColor: Color(0xFFD02127), + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + ), + ) + .toList() + ], + ), + ); + } +} diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index d4e9120e..22f31188 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -108,6 +108,7 @@ class _EndCallScreenState extends State { if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { + // todo mosa add new service Navigator.of(context).pop(); Navigator.of(context).pop(); } From 1f8a90e47b85f03bbedc91ca7eac3f22880cf641 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 17:15:52 +0300 Subject: [PATCH 036/124] 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 0afe3b3afd56a4957e263de5b1fc4ef39546e8f4 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 7 Jun 2021 10:41:30 +0300 Subject: [PATCH 037/124] livecare changes --- .../patient/LiveCarePatientServices.dart | 4 +- .../viewModel/LiveCarePatientViewModel.dart | 52 +++-- lib/screens/home/home_screen.dart | 7 - lib/screens/live_care/TestScreen.dart | 136 ------------- lib/screens/live_care/end_call_screen.dart | 181 ++++++++++++++---- .../live-care_transfer_to_admin.dart | 3 +- 6 files changed, 182 insertions(+), 201 deletions(-) delete mode 100644 lib/screens/live_care/TestScreen.dart diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 05b73393..b8712a9b 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -74,7 +74,7 @@ class LiveCarePatientServices extends BaseService { }, body: startCallReq.toJson(), isLiveCare: _isLive); } - Future endCallWithCharge(int vcID) async { + Future endCallWithCharge(int vcID, String altServiceList) async { hasError = false; await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) { @@ -84,7 +84,7 @@ class LiveCarePatientServices extends BaseService { super.error = error; }, body: { "VC_ID": vcID, - "generalid": "Cs2020@2016\$2958", + "AltServiceList": altServiceList, }, isLiveCare: _isLive); } diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index a64552aa..032c7a07 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -20,7 +20,8 @@ class LiveCarePatientViewModel extends BaseViewModel { StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; - List get alternativeServicesList => _liveCarePatientServices.alternativeServicesList; + List get alternativeServicesList => + _liveCarePatientServices.alternativeServicesList; DashboardService _dashboardService = locator(); @@ -94,9 +95,22 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - Future endCallWithCharge(int vcID) async { + setSelectedCheckboxValues(AlternativeService service, bool isSelected) { + int index = alternativeServicesList.indexOf(service); + if (index != -1) alternativeServicesList[index].isSelected = isSelected; + notifyListeners(); + } + + Future endCallWithCharge(int vcID, bool isConfirmed) async { setState(ViewState.BusyLocal); - await _liveCarePatientServices.endCallWithCharge(vcID); + + String selectedServicesString = ""; + if (isConfirmed) { + selectedServicesString = getSelectedAlternativeServices(); + } + + await _liveCarePatientServices.endCallWithCharge( + vcID, selectedServicesString); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); @@ -106,25 +120,35 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - Future transferToAdmin(int vcID, String notes) async { + String getSelectedAlternativeServices() { + List selectedServices = List(); + for (AlternativeService service in alternativeServicesList) { + if (service.isSelected) { + selectedServices.add(service.serviceID); + } + } + return selectedServices.toString(); + } + + Future getAlternativeServices(int vcID) async { setState(ViewState.BusyLocal); - await _liveCarePatientServices.transferToAdmin(vcID, notes); + await _liveCarePatientServices.getAlternativeServices(vcID); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { - await getPendingPatientERForDoctorApp(); setState(ViewState.Idle); } } - Future getAlternativeServices(int vcID) async { + Future transferToAdmin(int vcID, String notes) async { setState(ViewState.BusyLocal); - await _liveCarePatientServices.getAlternativeServices(vcID); + await _liveCarePatientServices.transferToAdmin(vcID, notes); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { + await getPendingPatientERForDoctorApp(); setState(ViewState.Idle); } } @@ -154,9 +178,7 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - // AlternativeServicesList demoServicesList = AlternativeServicesList(); - - setDemoData(){ + setDemoData() { alternativeServicesList.clear(); alternativeServicesList.add( AlternativeService(serviceID: 1, serviceName: "Medicine Home Delivery"), @@ -194,12 +216,4 @@ class LiveCarePatientViewModel extends BaseViewModel { AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), ); } - - setSelected(AlternativeService service, bool isSelected) { - int index = alternativeServicesList.indexOf(service); - if(index !=-1) - alternativeServicesList[index].isSelected = isSelected; - notifyListeners(); - } - } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index d079a477..85ea3506 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,19 +1,14 @@ -import 'package:doctor_app_flutter/config/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'; 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'; import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; -import 'package:doctor_app_flutter/screens/live_care/TestScreen.dart'; import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; @@ -22,7 +17,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'; @@ -342,7 +336,6 @@ class _HomeScreenState extends State { context, FadePage( page: LiveCarePatientScreen(), - // page: TestScreen(), ), ); }, diff --git a/lib/screens/live_care/TestScreen.dart b/lib/screens/live_care/TestScreen.dart deleted file mode 100644 index 974f2351..00000000 --- a/lib/screens/live_care/TestScreen.dart +++ /dev/null @@ -1,136 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; -import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.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/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:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class TestScreen extends StatefulWidget { - @override - _TestScreenState createState() => _TestScreenState(); -} - -class _TestScreenState extends State { - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.setDemoData(), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - isShowAppBar: false, - body: Container( - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - color: Colors.red[600], - title: "open dialog", //TranslationBase.of(context).close, - onPressed: () { - showAlternativesDialog(context, model, () { - model.alternativeServicesList.map((e) => () { - if (e.isSelected) { - print(e.serviceName); - } - }); - Navigator.of(context).pop(); - }); - }, - ), - ), - ), - ), - ); - } - - showAlternativesDialog(BuildContext context, LiveCarePatientViewModel model, Function okFunction) { - return showDialog( - context: context, - barrierDismissible: false, // user must tap button! - builder: (_) { - return Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AlertDialog( - title: null, - content: Container( - height: MediaQuery.of(context).size.height / 2, - child: CheckBoxListWidget(model: model,), - ), - actions: [ - AppButton( - onPressed: (){ - okFunction(); - }, - title: TranslationBase.of(context).noteConfirm, - fontColor: Colors.white, - color: Colors.green[600], - ), - AppButton( - onPressed: () { - Navigator.of(context).pop(); - }, - title: TranslationBase.of(context).cancel, - fontColor: Colors.white, - color: Colors.red[600], - ), - ], - ), - ], - ), - ); - }); - } -} - -class CheckBoxListWidget extends StatefulWidget { - final LiveCarePatientViewModel model; - const CheckBoxListWidget({ - Key key, this.model, - }) : super(key: key); - - @override - _CheckBoxListState createState() => _CheckBoxListState(); -} - -class _CheckBoxListState extends State { - @override - Widget build(BuildContext context) { - return SingleChildScrollView( - child: Column( - children: [ - ...widget.model - .alternativeServicesList - .map( - (element) => Container( - child: CheckboxListTile( - title: AppText( - element.serviceName, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.2, - ), - value: element.isSelected, - onChanged: (newValue) { - setState(() { - widget.model.setSelected( - element, newValue); - }); - }, - activeColor: Color(0xFFD02127), - controlAffinity: - ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), - ), - ) - .toList() - ], - ), - ); - } -} diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 22f31188..ee1a036d 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_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/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -51,41 +52,48 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); await liveCareModel .startCall(isReCall: false, vCID: widget.patient.vcId) - .then((value) async{ + .then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); - }else - await VideoChannel.openVideoCallScreen( - kToken: liveCareModel.startCallRes.openTokenID, - kSessionId: liveCareModel.startCallRes.openSessionID, - kApiKey: '46209962', - vcId: widget.patient.vcId, - tokenID: await liveCareModel.getToken(), - generalId: GENERAL_ID, - doctorId: liveCareModel.doctorProfile.doctorID, - onFailure: (String error) { - DrAppToastMsg.showErrorToast(error); - }, - onCallEnd: () async{ - GifLoaderDialogUtils.showMyDialog(context); - GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCall(widget.patient.vcId, false,); - GifLoaderDialogUtils.hideDialog(context); - if (liveCareModel.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(liveCareModel.error); - } - }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) async{ - GifLoaderDialogUtils.showMyDialog(context); - GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCall(widget.patient.vcId, sessionStatusModel.sessionStatus == 3,); - GifLoaderDialogUtils.hideDialog(context); - if (liveCareModel.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(liveCareModel.error); - } - }); + } else + await VideoChannel.openVideoCallScreen( + kToken: liveCareModel.startCallRes.openTokenID, + kSessionId: liveCareModel.startCallRes.openSessionID, + kApiKey: '46209962', + vcId: widget.patient.vcId, + tokenID: await liveCareModel.getToken(), + generalId: GENERAL_ID, + doctorId: liveCareModel.doctorProfile.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + }, + onCallEnd: () async { + GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.endCall( + widget.patient.vcId, + false, + ); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }, + onCallNotRespond: + (SessionStatusModel sessionStatusModel) async { + GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.endCall( + widget.patient.vcId, + sessionStatusModel.sessionStatus == 3, + ); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }); }); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { @@ -103,14 +111,23 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCallWithCharge(widget.patient.vcId); + await liveCareModel.getAlternativeServices(widget.patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { - // todo mosa add new service - Navigator.of(context).pop(); - Navigator.of(context).pop(); + showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.endCallWithCharge(widget.patient.vcId, isConfirmed); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } else { + DrAppToastMsg.showSuccesToast("You successfully completed call with charge"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); } }); }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), @@ -247,7 +264,7 @@ class _EndCallScreenState extends State { fontWeight: FontWeight.w700, color: Colors.red[600], title: "Close", //TranslationBase.of(context).close, - onPressed: () { + onPressed: () { Navigator.of(context).pop(); }, ), @@ -263,4 +280,96 @@ class _EndCallScreenState extends State { ), ); } + + showAlternativesDialog(BuildContext context, LiveCarePatientViewModel model, + Function(bool) okFunction) { + return showDialog( + context: context, + barrierDismissible: false, // user must tap button! + builder: (_) { + return Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AlertDialog( + title: null, + content: Container( + height: MediaQuery.of(context).size.height / 2, + child: CheckBoxListWidget( + model: model, + ), + ), + actions: [ + AppButton( + onPressed: (){ + Navigator.of(context).pop(); + okFunction(true); + }, + title: TranslationBase.of(context).noteConfirm, + fontColor: Colors.white, + color: Colors.green[600], + ), + AppButton( + onPressed: () { + Navigator.of(context).pop(); + okFunction(false); + }, + title: TranslationBase.of(context).cancel, + fontColor: Colors.white, + color: Colors.red[600], + ), + ], + ), + ], + ), + ); + }); + } +} + +class CheckBoxListWidget extends StatefulWidget { + final LiveCarePatientViewModel model; + + const CheckBoxListWidget({ + Key key, + this.model, + }) : super(key: key); + + @override + _CheckBoxListState createState() => _CheckBoxListState(); +} + +class _CheckBoxListState extends State { + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Column( + children: [ + ...widget.model.alternativeServicesList + .map( + (element) => Container( + child: CheckboxListTile( + title: AppText( + element.serviceName, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.2, + ), + value: element.isSelected, + onChanged: (newValue) { + setState(() { + widget.model + .setSelectedCheckboxValues(element, newValue); + }); + }, + activeColor: Color(0xFFD02127), + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + ), + ) + .toList() + ], + ), + ); + } } diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index c5bcf304..2d0fb7d7 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -120,11 +120,12 @@ class _LivaCareTransferToAdminState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - model.endCallWithCharge(widget.patient.vcId); + model.transferToAdmin(widget.patient.vcId, noteController.text); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { + DrAppToastMsg.showSuccesToast("You successfully transfer to admin"); Navigator.of(context).pop(); Navigator.of(context).pop(); Navigator.of(context).pop(); From 0fe6d880fdfbaf70ea066a9c11e04cb37e606e18 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 7 Jun 2021 10:53:36 +0300 Subject: [PATCH 038/124] add livecare send instructions --- lib/config/config.dart | 1 + .../patient/LiveCarePatientServices.dart | 13 +++++++++++++ .../viewModel/LiveCarePatientViewModel.dart | 12 ++++++++++++ lib/screens/live_care/end_call_screen.dart | 19 ++++++++++++++++++- 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 41e3313d..92e4e188 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -89,6 +89,7 @@ const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RES const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; +const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index b8712a9b..7e42380d 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -103,6 +103,19 @@ class LiveCarePatientServices extends BaseService { }, isLiveCare: _isLive); } + Future sendSMSInstruction(int vcID) async { + hasError = false; + await baseAppClient.post(SEND_SMS_INSTRUCTIONS, + onSuccess: (dynamic response, int statusCode) { + transferToAdminResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: { + "VC_ID": vcID, + }, isLiveCare: _isLive); + } + Future getAlternativeServices(int vcID) async { hasError = false; alternativeServicesList.clear(); diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 032c7a07..d2786388 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -153,6 +153,18 @@ class LiveCarePatientViewModel extends BaseViewModel { } } + Future sendSMSInstruction(int vcID) async { + setState(ViewState.BusyLocal); + await _liveCarePatientServices.sendSMSInstruction(vcID); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + setState(ViewState.ErrorLocal); + } else { + await getPendingPatientERForDoctorApp(); + setState(ViewState.Idle); + } + } + searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index ee1a036d..c4e52b34 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -136,7 +136,24 @@ class _EndCallScreenState extends State { TranslationBase.of(context).instruction, "", 'patient/health_summary.png', - onTap: () {}, + onTap: () { + Helpers.showConfirmationDialog(context, + "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC}${TranslationBase.of(context).instruction} ?", + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + liveCareModel.sendSMSInstruction(widget.patient.vcId); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } else { + DrAppToastMsg.showSuccesToast("You successfully sent SMS instructions"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); + }, isInPatient: isInpatient, isDartIcon: true, isDisable: true, From 39887f3eadfe76e2ffa895b7d6825a76d6a6bcea Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 12:25:24 +0300 Subject: [PATCH 039/124] 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 d57b331df2372688ad38fef1579389eb4c70c3be Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 14:46:39 +0300 Subject: [PATCH 040/124] add timer --- ios/Podfile.lock | 327 -------------------------- lib/config/localized_values.dart | 2 +- lib/util/date-utils.dart | 7 +- lib/widgets/patients/PatientCard.dart | 71 +++++- pubspec.lock | 6 +- 5 files changed, 73 insertions(+), 340 deletions(-) delete mode 100644 ios/Podfile.lock diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 44151727..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.1 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d1e67692..11f31ba6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -712,7 +712,7 @@ const Map> localizedValues = { 'days': {'en': "Days", 'ar': "أيام"}, 'months': {'en': "Months", 'ar': "أشهر"}, 'years': {'en': "Years", 'ar': "سنين"}, - 'hr': {'en': "HR", 'ar': "س"}, + 'hr': {'en': "Hr", 'ar': "س"}, 'min': {'en': "Min", 'ar': "د"}, 'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"}, 'referralStatusHold': {'en': "Hold", 'ar': "معلق"}, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 9ce078ed..297f358e 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -68,20 +68,21 @@ class AppDateUtils { return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}"; } - static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context) { + static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context, {bool isShowSecond = false, bool isShowDays = true }) { DateTime now = DateTime.now(); - // DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0)); var difference = now.difference(firstDate); int minutesInDays = difference.inMinutes; + int secondInDays = difference.inSeconds; int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int + int second = secondInDays % 60; int minutes = minutesInDays % 60; int days = hoursInDays ~/ 24; int hours = hoursInDays % 24; double hoursInOneDay = difference.inHours / difference.inDays; - return "$days ${TranslationBase.of(context).days}, $hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}"; + return (isShowDays?"$days ${TranslationBase.of(context).days},":"")+ "$hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}"+ (isShowSecond?", $second Sec":""); } static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 2174e6d5..098cf1e2 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -19,7 +19,7 @@ class PatientCard extends StatelessWidget { final bool isFromSearch; final bool isFromLiveCare; - const PatientCard( + PatientCard( {Key key, this.patientInfo, this.onTap, @@ -33,6 +33,7 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { + return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), @@ -257,9 +258,9 @@ class PatientCard extends StatelessWidget { patientInfo.fullName) : (Helpers.capitalize( patientInfo.firstName) + - " " + - Helpers.capitalize( - patientInfo.lastName)), + " " + + Helpers.capitalize( + patientInfo.lastName)), fontSize: 16, color: Color(0xff2e303a), fontWeight: FontWeight.w700, @@ -267,6 +268,8 @@ class PatientCard extends StatelessWidget { textOverflow: TextOverflow.ellipsis, ), ), + if(isFromLiveCare) + ShowTimer(patientInfo: patientInfo,), if (patientInfo.gender == 1) Icon( DoctorApp.male_2, @@ -515,12 +518,68 @@ class PatientCard extends StatelessWidget { height: 25, width: 35, )), - ]) - : SizedBox() + ]) + : SizedBox() ], ), onTap: onTap, )), )); } + + +} + +class ShowTimer extends StatefulWidget { + final PatiantInformtion patientInfo; + + + const ShowTimer({ + Key key, this.patientInfo, + }) : super(key: key); + + @override + _ShowTimerState createState() => _ShowTimerState(); +} + +class _ShowTimerState extends State { + + int remainingTime = 600; + String displayTime = ''; + + @override + Widget build(BuildContext context) { + if (displayTime.isEmpty) { + startShowTimer(); + } + return AppText( + "$displayTime", + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: 11, + ); + } + + startShowTimer() { + // this.remainingTime--; + setState(() { + displayTime = this.generateShowTimerString(); + }); + + Future.delayed(Duration(seconds: 1), () { + if (this.remainingTime > 0) { + startShowTimer(); + } + }); + } + + generateShowTimerString() { + DateTime now = DateTime.now(); + DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); + String timer = AppDateUtils.differenceBetweenDateAndCurrent( + liveCareDate, context, isShowSecond: true, isShowDays: false); + + return timer; + } } 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 f80215b6bb4e8d70741c2bd2a1f67c6ec779e281 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 16:48:58 +0300 Subject: [PATCH 041/124] fix doctor id spelling in live care service, fix colors in --- lib/core/service/patient/LiveCarePatientServices.dart | 3 ++- lib/screens/live_care/end_call_screen.dart | 9 +++++++-- .../profile_screen/PatientProfileCardModel.dart | 5 ++++- .../patients/profile/PatientProfileButton.dart | 11 ++++++----- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index ed09bbb9..92d2e930 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -1,4 +1,3 @@ -import 'dart:collection'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; @@ -104,6 +103,8 @@ class LiveCarePatientServices extends BaseService { Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { hasError = false; + await getDoctorProfile( ); + isLoginRequestModel.doctorId = super.doctorProfile.doctorID; await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index ee1a036d..0f6db11c 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -48,7 +48,9 @@ class _EndCallScreenState extends State { final List cardsList = [ PatientProfileCardModel(TranslationBase.of(context).resume, TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', - isInPatient: isInpatient, onTap: () async { + isInPatient: isInpatient, + color: Colors.green[800], + onTap: () async { GifLoaderDialogUtils.showMyDialog(context); await liveCareModel .startCall(isReCall: false, vCID: widget.patient.vcId) @@ -105,7 +107,9 @@ class _EndCallScreenState extends State { TranslationBase.of(context).consultation, '', 'patient/vital_signs.png', - isInPatient: isInpatient, onTap: () { + isInPatient: isInpatient, + color: Colors.red[800], + onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { @@ -230,6 +234,7 @@ class _EndCallScreenState extends State { isLoading: cardsList[index].isLoading, isDartIcon: cardsList[index].isDartIcon, dartIcon: cardsList[index].dartIcon, + color: cardsList[index].color, ), ), ], diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index eb9a3eaa..e4351d91 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -13,6 +13,7 @@ class PatientProfileCardModel { final bool isSelectInpatient; final bool isDartIcon; final IconData dartIcon; + final Color color; PatientProfileCardModel( this.nameLine1, @@ -25,6 +26,8 @@ class PatientProfileCardModel { this.onTap, this.isDischargedPatient = false, this.isSelectInpatient = false, - this.isDartIcon = false,this.dartIcon + this.isDartIcon = false, + this.dartIcon, + this.color, }); } diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index ef285150..36755502 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -28,6 +28,7 @@ class PatientProfileButton extends StatelessWidget { final bool isDartIcon; final IconData dartIcon; final bool isFromLiveCare; + final Color color; PatientProfileButton({ Key key, @@ -47,7 +48,7 @@ class PatientProfileButton extends StatelessWidget { this.isDischargedPatient = false, this.isSelectInpatient = false, this.isDartIcon = false, - this.dartIcon, this.isFromLiveCare = false, + this.dartIcon, this.isFromLiveCare = false, this.color, }) : super(key: key); @override @@ -73,7 +74,7 @@ class PatientProfileButton extends StatelessWidget { children: [ Container( child: isDartIcon ? Icon( - dartIcon, size: 30, color: Color(0xFF333C45),) : new Image + dartIcon, size: 30, color: color?? Color(0xFF333C45),) : new Image .asset( url + icon, width: 30, @@ -93,14 +94,14 @@ class PatientProfileButton extends StatelessWidget { children: [ AppText( !projectsProvider.isArabic ? this.nameLine1 : nameLine2, - color: Color(0xFF2B353E), + color: color??Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( !projectsProvider.isArabic ? this.nameLine2 : nameLine1, - color: Color(0xFF2B353E), + color: color??Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, @@ -116,7 +117,7 @@ class PatientProfileButton extends StatelessWidget { color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white, borderRadius: BorderRadius.all(Radius.circular(10)), border: Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), + color: color??Color(0xffBBBBBB), width: 1, )), ), From ec9f628b67d7749e6c40e505737b65674a3c7fe0 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 7 Jun 2021 17:00:46 +0300 Subject: [PATCH 042/124] Merge branch 'development' into procedure_refactoring # Conflicts: # lib/core/service/patient/LiveCarePatientServices.dart --- lib/config/config.dart | 8 +- lib/core/enum/PatientType.dart | 4 + .../patient/MyReferralPatientService.dart | 36 +++ .../patient-doctor-referral-service.dart | 31 +++ .../patient/referred_patient_service.dart | 36 --- .../viewModel/patient-referral-viewmodel.dart | 31 ++- lib/core/viewModel/referred_view_model.dart | 24 -- lib/locator.dart | 4 - .../my-referral-inpatient-screen.dart | 4 +- .../referral/referred-patient-screen.dart | 257 +++++++++++------- .../patient-referral-item-widget.dart | 2 +- 11 files changed, 273 insertions(+), 164 deletions(-) create mode 100644 lib/core/enum/PatientType.dart delete mode 100644 lib/core/service/patient/referred_patient_service.dart delete mode 100644 lib/core/viewModel/referred_view_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index bd701836..91f8bc9d 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"; @@ -56,6 +56,8 @@ const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddRefe const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient'; + const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; @@ -179,6 +181,8 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_OUTPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferredOutPatient"; + const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; diff --git a/lib/core/enum/PatientType.dart b/lib/core/enum/PatientType.dart new file mode 100644 index 00000000..96fd9ae5 --- /dev/null +++ b/lib/core/enum/PatientType.dart @@ -0,0 +1,4 @@ +enum PatientType{ + IN_PATIENT, + OUT_PATIENT, +} \ No newline at end of file diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 536e68a7..05a937ee 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -42,6 +42,42 @@ class MyReferralInPatientService extends BaseService { ); } + Future getMyReferralOutPatientService() async { + hasError = false; + Map body = Map(); + await getDoctorProfile(); + body['DoctorID'] = doctorProfile.doctorID; + body['FirstName'] = "0"; + body['MiddleName'] = "0"; + body['LastName'] = "0"; + body['PatientMobileNumber'] = "0"; + body['PatientIdentificationID'] = "0"; + body['PatientID'] = 0; + body['From'] = "0"; + body['To'] = "0"; + body['stamp'] = DateTime.now().toIso8601String(); + body['IsLoginForDoctorApp'] = true; + body['IPAdress'] = "11.11.11.11"; + body['PatientOutSA'] = false; + body['PatientTypeID'] = 1; + myReferralPatients.clear(); + await baseAppClient.post( + GET_MY_REFERRAL_OUTPATIENT, + onSuccess: (dynamic response, int statusCode) { + if (response['List_MyReferredOutPatient'] != null) { + response['List_MyReferredOutPatient'].forEach((v) { + myReferralPatients.add(MyReferralPatientModel.fromJson(v)); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + Future replay( String referredDoctorRemarks, MyReferralPatientModel referral) async { hasError = false; diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index c83c74c9..c9126845 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -157,6 +157,37 @@ class PatientReferralService extends LookupService { ); } + Future getMyReferredOutPatient() async { + hasError = false; + RequestMyReferralPatientModel _requestMyReferralPatient = + RequestMyReferralPatientModel(); + // _requestMyReferralPatient.doctorID = 1002; + DoctorProfileModel doctorProfile = await getDoctorProfile(); + + await baseAppClient.post( + GET_MY_REFERRED_OUT_PATIENT, + onSuccess: (dynamic response, int statusCode) { + listMyReferredPatientModel.clear(); + + response['List_MyOutPatientReferral'].forEach((v) { + MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); + if (doctorProfile != null) { + item.isReferralDoctorSameBranch = + doctorProfile.projectID == item.projectID; + } else { + item.isReferralDoctorSameBranch = false; + } + listMyReferredPatientModel.add(item); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _requestMyReferralPatient.toJson(), + ); + } + Future getPendingReferralList() async { hasError = false; DoctorProfileModel doctorProfile = await getDoctorProfile(); diff --git a/lib/core/service/patient/referred_patient_service.dart b/lib/core/service/patient/referred_patient_service.dart deleted file mode 100644 index 0af9b077..00000000 --- a/lib/core/service/patient/referred_patient_service.dart +++ /dev/null @@ -1,36 +0,0 @@ -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/doctor/verify_referral_doctor_remarks.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; - -class ReferredPatientService extends BaseService { - List _listMyReferredPatientModel = []; - - List get listMyReferredPatientModel => - _listMyReferredPatientModel; - - RequestMyReferralPatientModel _requestMyReferralPatient = - RequestMyReferralPatientModel(); - VerifyReferralDoctorRemarks _verifyreferraldoctorremarks = - VerifyReferralDoctorRemarks(); - - Future getMyReferredPatient() async { - await baseAppClient.post( - GET_MY_REFERRED_PATIENT, - onSuccess: (dynamic response, int statusCode) { - _listMyReferredPatientModel.clear(); - response['List_MyReferredPatient'].forEach((v) { - listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v)); - }); - // print(response['List_MyReferredPatient']); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: _requestMyReferralPatient.toJson(), - ); - } - -} diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index a414c200..6e3e310e 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -28,6 +28,7 @@ class PatientReferralViewModel extends BaseViewModel { DischargedPatientService _dischargedPatientService = locator(); + List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; @@ -133,8 +134,11 @@ class PatientReferralViewModel extends BaseViewModel { return null; } - Future getMyReferredPatient() async { - setState(ViewState.Busy); + Future getMyReferredPatient({bool isFirstTime = true}) async { + if (isFirstTime) + setState(ViewState.Busy); + else + setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredPatient(); if (_referralPatientService.hasError) { error = _referralPatientService.error; @@ -143,6 +147,19 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getMyReferredOutPatient({bool isFirstTime = true}) async { + if (isFirstTime) + setState(ViewState.Busy); + else + setState(ViewState.BusyLocal); + await _referralPatientService.getMyReferredOutPatient(); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + MyReferredPatientModel getReferredPatientItem(int index) { return listMyReferredPatientModel[index]; } @@ -167,6 +184,16 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getMyReferralOutPatientService() async { + setState(ViewState.Busy); + await _myReferralService.getMyReferralOutPatientService(); + if (_myReferralService.hasError) { + error = _myReferralService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future replay( String referredDoctorRemarks, MyReferralPatientModel referral) async { setState(ViewState.Busy); diff --git a/lib/core/viewModel/referred_view_model.dart b/lib/core/viewModel/referred_view_model.dart deleted file mode 100644 index 173aa60a..00000000 --- a/lib/core/viewModel/referred_view_model.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/patient/referred_patient_service.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; - -import '../../locator.dart'; -import 'base_view_model.dart'; - -class ReferredPatientViewModel extends BaseViewModel { - ReferredPatientService _referralPatientService = - locator(); - - List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; - - Future getMyReferredPatient() async { - setState(ViewState.Busy); - await _referralPatientService.getMyReferredPatient(); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } -} diff --git a/lib/locator.dart b/lib/locator.dart index 66ec9161..5ee46b4d 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -35,7 +35,6 @@ import 'core/service/patient/patientInPatientService.dart'; import 'core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'core/service/patient_medical_file/radiology/radiology_service.dart'; import 'core/service/patient/referral_patient_service.dart'; -import 'core/service/patient/referred_patient_service.dart'; import 'core/service/home/schedule_service.dart'; import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart'; @@ -54,7 +53,6 @@ import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/prescriptions_view_model.dart'; import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; -import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; GetIt locator = GetIt.instance; @@ -65,7 +63,6 @@ void setupLocator() { locator.registerLazySingleton(() => DoctorReplyService()); locator.registerLazySingleton(() => ScheduleService()); locator.registerLazySingleton(() => ReferralPatientService()); - locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => PatientService()); locator.registerLazySingleton(() => DashboardService()); @@ -97,7 +94,6 @@ void setupLocator() { locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => ScheduleViewModel()); locator.registerFactory(() => ReferralPatientViewModel()); - locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => PatientViewModel()); locator.registerFactory(() => DashboardViewModel()); diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index fcbd11b7..5665a30f 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -42,12 +42,10 @@ class MyReferralInPatientScreen extends StatelessWidget { : SingleChildScrollView( child: Container( margin: EdgeInsets.only(top: 70), - // color: Colors.white, - // height: MediaQuery.of(context).size.height, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // SizedBox(height: 50), + ...List.generate( model.myReferralPatients.length, (index) => InkWell( diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index dc2bf798..c95a28d8 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.dart'; @@ -6,12 +7,15 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-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/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ReferredPatientScreen extends StatelessWidget { - // previous design page is: MyReferredPatient + + PatientType patientType = PatientType.IN_PATIENT; + @override Widget build(BuildContext context) { return BaseView( @@ -20,103 +24,172 @@ class ReferredPatientScreen extends StatelessWidget { baseViewModel: model, isShowAppBar: false, appBarTitle: TranslationBase.of(context).referredPatient, - body: model.listMyReferredPatientModel == null || - model.listMyReferredPatientModel.length == 0 - ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: 100, + body: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 70), + child: PatientTypeRadioWidget( + (patientType) async { + this.patientType = patientType; + GifLoaderDialogUtils.showMyDialog(context); + if (patientType == PatientType.IN_PATIENT) { + await model.getMyReferredPatient(isFirstTime: false); + } else { + await model.getMyReferredOutPatient(isFirstTime: false); + } + GifLoaderDialogUtils.hideDialog(context); + }, + ), + ), + model.listMyReferredPatientModel == null || + model.listMyReferredPatientModel.length == 0 + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).referralEmptyMsg, + color: Theme.of(context).errorColor, + ), + ) + ], ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ) - : SingleChildScrollView( - // DoctorApplication.svc/REST/GtMyReferredPatient - child: Container( - margin: EdgeInsets.only(top: 70), - child: Column( - children: [ - // const Divider( - // color: Color(0xffCCCCCC), - // height: 1, - // thickness: 2, - // indent: 0, - // endIndent: 0, - // ), - ...List.generate( - model.listMyReferredPatientModel.length, - (index) => InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferredPatientDetailScreen( - model.getReferredPatientItem(index)), + ) + : Expanded( + child: SingleChildScrollView( + // DoctorApplication.svc/REST/GtMyReferredPatient + child: Container( + child: Column( + children: [ + ...List.generate( + model.listMyReferredPatientModel.length, + (index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferredPatientDetailScreen( + model.getReferredPatientItem(index)), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model + .getReferredPatientItem(index) + .referralStatusDesc, + referralStatusCode: model + .getReferredPatientItem(index) + .referralStatus, + patientName: + "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientGender: + model.getReferredPatientItem(index).gender, + referredDate: + AppDateUtils.convertDateFromServerFormat( + model + .getReferredPatientItem(index) + .referralDate, + "dd/MM/yyyy"), + referredTime: + AppDateUtils.convertDateFromServerFormat( + model + .getReferredPatientItem(index) + .referralDate, + "hh:mm a"), + patientID: + "${model.getReferredPatientItem(index).patientID}", + isSameBranch: model + .getReferredPatientItem(index) + .isReferralDoctorSameBranch, + isReferral: false, + remark: model + .getReferredPatientItem(index) + .referringDoctorRemarks, + nationality: model + .getReferredPatientItem(index) + .nationalityName, + nationalityFlag: model + .getReferredPatientItem(index) + .nationalityFlagURL, + doctorAvatar: model + .getReferredPatientItem(index) + .doctorImageURL, + referralDoctorName: + "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + clinicDescription: model + .getReferredPatientItem(index) + .referralClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), ), - ); - }, - child: PatientReferralItemWidget( - referralStatus:model.getReferredPatientItem(index).referralStatusDesc, - referralStatusCode: model - .getReferredPatientItem(index) - .referralStatus, - patientName: - "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", - patientGender: - model.getReferredPatientItem(index).gender, - referredDate: AppDateUtils.convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "dd/MM/yyyy"), - referredTime: AppDateUtils.convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "hh:mm a"), - patientID: - "${model.getReferredPatientItem(index).patientID}", - isSameBranch: model - .getReferredPatientItem(index) - .isReferralDoctorSameBranch, - isReferral: false, - remark: model - .getReferredPatientItem(index) - .referringDoctorRemarks, - nationality: model - .getReferredPatientItem(index) - .nationalityName, - nationalityFlag: model - .getReferredPatientItem(index) - .nationalityFlagURL, - doctorAvatar: model - .getReferredPatientItem(index) - .doctorImageURL, - referralDoctorName: - "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", - clinicDescription: model - .getReferredPatientItem(index) - .referralClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), - ), + ), + ], ), ), - ], - ), + ), ), - ), + ], + ), ), ); } } + +class PatientTypeRadioWidget extends StatefulWidget { + final Function(PatientType) radioOnChange; + + PatientTypeRadioWidget(this.radioOnChange); + + @override + _PatientTypeRadioWidgetState createState() => + _PatientTypeRadioWidgetState(this.radioOnChange); +} + +class _PatientTypeRadioWidgetState extends State { + final Function(PatientType) radioOnChange; + + _PatientTypeRadioWidgetState(this.radioOnChange); + + PatientType patientType = PatientType.IN_PATIENT; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Expanded( + child: RadioListTile( + title: AppText(TranslationBase.of(context).inPatient), + value: PatientType.IN_PATIENT, + groupValue: patientType, + onChanged: (PatientType value) { + setState(() { + patientType = value; + radioOnChange(value); + }); + }, + ), + ), + Expanded( + child: RadioListTile( + title: AppText(TranslationBase.of(context).outpatient), + value: PatientType.OUT_PATIENT, + groupValue: patientType, + onChanged: (PatientType value) { + setState(() { + patientType = value; + radioOnChange(value); + }); + }, + ), + ), + ], + ); + } +} diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index a08282c0..6e581954 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -215,7 +215,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), Expanded( child: AppText( - remark, + remark??"", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, From a1abcaa7c08144ddd65a77b7ac3d5af643d8f5f0 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Jun 2021 17:05:51 +0300 Subject: [PATCH 043/124] fix live care issues --- android/app/build.gradle | 10 ++++++++-- .../kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java | 6 +++--- android/build.gradle | 2 ++ ios/Runner/VideoViewController.swift | 2 +- lib/core/service/patient/LiveCarePatientServices.dart | 2 +- pubspec.lock | 6 +++--- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index b7605ad0..16960d54 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -54,6 +54,11 @@ android { signingConfig signingConfigs.debug } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } flutter { @@ -74,9 +79,10 @@ dependencies { //permissions implementation 'pub.devrel:easypermissions:0.4.0' //retrofit - implementation 'com.squareup.retrofit2:retrofit:2.6.2' + implementation 'com.squareup.retrofit2:retrofit:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.6.2' - implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' } apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java index 1c907089..80f60c33 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java @@ -134,8 +134,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi @SuppressLint("ClickableViewAccessibility") private void initUI() { - mPublisherViewContainer = (FrameLayout) findViewById(R.id.local_video_view_container); - mSubscriberViewContainer = (RelativeLayout) findViewById(R.id.remote_video_view_container); + mPublisherViewContainer = findViewById(R.id.local_video_view_container); + mSubscriberViewContainer = findViewById(R.id.remote_video_view_container); apiKey = getIntent().getStringExtra("apiKey"); sessionId = getIntent().getStringExtra("sessionId"); @@ -184,7 +184,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi videoCallPresenter.callClintConnected(sessionStatusModel); } }; - mConnectedHandler.postDelayed(mConnectedRunnable, 30 * 1000); + mConnectedHandler.postDelayed(mConnectedRunnable, 55 * 1000); } diff --git a/android/build.gradle b/android/build.gradle index ea0f0026..badc1b18 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -16,10 +16,12 @@ allprojects { repositories { google() jcenter() + mavenCentral() maven { url 'https://tokbox.bintray.com/maven' } } } + rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" diff --git a/ios/Runner/VideoViewController.swift b/ios/Runner/VideoViewController.swift index 44e45f3a..0fb39f7c 100644 --- a/ios/Runner/VideoViewController.swift +++ b/ios/Runner/VideoViewController.swift @@ -31,7 +31,7 @@ class ViewController: UIViewController { var callBack: ICallProtocol? var timer = Timer() - var seconds = 30 + var seconds = 55 var isUserConnect : Bool = false diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index ed09bbb9..949b3de4 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -19,7 +19,7 @@ class LiveCarePatientServices extends BaseService { bool _isFinished = false; - bool _isLive = false; + bool _isLive = true; bool get isFinished => _isFinished; 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 792c85e28ac2b812113ceaef81b49f596ee2cf54 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 17:07:46 +0300 Subject: [PATCH 044/124] fix live care icon size --- lib/screens/home/home_patient_card.dart | 6 ++++-- lib/screens/home/home_screen.dart | 1 + lib/util/date-utils.dart | 7 ++++++- lib/widgets/patients/PatientCard.dart | 6 ++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index bdaac7a7..6f6712ec 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -10,6 +10,7 @@ class HomePatientCard extends StatelessWidget { final String text; final Color textColor; final Function onTap; + final double iconSize; HomePatientCard({ @required this.backgroundColor, @@ -18,6 +19,7 @@ class HomePatientCard extends StatelessWidget { @required this.text, @required this.textColor, @required this.onTap, + this.iconSize = 30, }); @override @@ -41,7 +43,7 @@ class HomePatientCard extends StatelessWidget { height: 25.0, child: Icon( cardIcon, - size: 60, + size: iconSize * 2, color: backgroundIconColor, ), ), @@ -52,7 +54,7 @@ class HomePatientCard extends StatelessWidget { children: [ Icon( cardIcon, - size: 30, + size: iconSize, color: textColor, ), SizedBox( diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 85ea3506..ab0fe73f 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -329,6 +329,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], + iconSize: 24, text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", onTap: () { diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 297f358e..a7d03076 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -82,7 +82,12 @@ class AppDateUtils { double hoursInOneDay = difference.inHours / difference.inDays; - return (isShowDays?"$days ${TranslationBase.of(context).days},":"")+ "$hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}"+ (isShowSecond?", $second Sec":""); + return (isShowDays + ? (days > 0 ? "$days ${TranslationBase.of(context).days}," : '') + : "") + + (hours > 0 ? "$hours ${TranslationBase.of(context).hr}," : "") + + " $minutes ${TranslationBase.of(context).min}" + + (isShowSecond ? ", $second Sec" : ""); } static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 098cf1e2..6f218263 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -268,8 +268,7 @@ class PatientCard extends StatelessWidget { textOverflow: TextOverflow.ellipsis, ), ), - if(isFromLiveCare) - ShowTimer(patientInfo: patientInfo,), + if (patientInfo.gender == 1) Icon( DoctorApp.male_2, @@ -280,6 +279,9 @@ class PatientCard extends StatelessWidget { DoctorApp.female_1, color: Colors.pink, ), + + if(isFromLiveCare) + ShowTimer(patientInfo: patientInfo,), ]), ), Row( From 8a8b55d2de45efff498f06890d12335c4a156670 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 17:12:54 +0300 Subject: [PATCH 045/124] move show timer to its own file --- .../live_care/live_care_patient_screen.dart | 2 +- lib/screens/patients/InPatientPage.dart | 3 +- .../out_patient/out_patient_screen.dart | 4 +- .../patient_search_result_screen.dart | 4 +- .../{ => patient_card}/PatientCard.dart | 58 +----------------- .../patients/patient_card/ShowTimer.dart | 59 +++++++++++++++++++ 6 files changed, 66 insertions(+), 64 deletions(-) rename lib/widgets/patients/{ => patient_card}/PatientCard.dart (96%) create mode 100644 lib/widgets/patients/patient_card/ShowTimer.dart diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 51757bf0..0b741989 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart' import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/PatientCard.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/app_texts_widget.dart'; diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index 1b42d305..e9e2c2d1 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -1,10 +1,9 @@ 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/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.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_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 30400c65..0a85ff26 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,10 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.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/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -14,7 +12,7 @@ import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.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/errors/error_message.dart'; diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 02bde8d0..8044e991 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -10,13 +10,11 @@ import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.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/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart similarity index 96% rename from lib/widgets/patients/PatientCard.dart rename to lib/widgets/patients/patient_card/PatientCard.dart index 6f218263..b90eecd3 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -9,6 +9,8 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'ShowTimer.dart'; + class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; final Function onTap; @@ -530,58 +532,4 @@ class PatientCard extends StatelessWidget { } -} - -class ShowTimer extends StatefulWidget { - final PatiantInformtion patientInfo; - - - const ShowTimer({ - Key key, this.patientInfo, - }) : super(key: key); - - @override - _ShowTimerState createState() => _ShowTimerState(); -} - -class _ShowTimerState extends State { - - int remainingTime = 600; - String displayTime = ''; - - @override - Widget build(BuildContext context) { - if (displayTime.isEmpty) { - startShowTimer(); - } - return AppText( - "$displayTime", - color: Colors.red, - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 11, - ); - } - - startShowTimer() { - // this.remainingTime--; - setState(() { - displayTime = this.generateShowTimerString(); - }); - - Future.delayed(Duration(seconds: 1), () { - if (this.remainingTime > 0) { - startShowTimer(); - } - }); - } - - generateShowTimerString() { - DateTime now = DateTime.now(); - DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); - String timer = AppDateUtils.differenceBetweenDateAndCurrent( - liveCareDate, context, isShowSecond: true, isShowDays: false); - - return timer; - } -} +} \ No newline at end of file diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart new file mode 100644 index 00000000..b769588b --- /dev/null +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -0,0 +1,59 @@ + +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class ShowTimer extends StatefulWidget { + final PatiantInformtion patientInfo; + + + const ShowTimer({ + Key key, this.patientInfo, + }) : super(key: key); + + @override + _ShowTimerState createState() => _ShowTimerState(); +} + +class _ShowTimerState extends State { + + int remainingTime = 600; + String displayTime = ''; + + @override + Widget build(BuildContext context) { + if (displayTime.isEmpty) { + startShowTimer(); + } + return AppText( + "$displayTime", + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: 11, + ); + } + + startShowTimer() { + // this.remainingTime--; + setState(() { + displayTime = this.generateShowTimerString(); + }); + + Future.delayed(Duration(seconds: 1), () { + if (this.remainingTime > 0) { + startShowTimer(); + } + }); + } + + generateShowTimerString() { + DateTime now = DateTime.now(); + DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); + String timer = AppDateUtils.differenceBetweenDateAndCurrent( + liveCareDate, context, isShowSecond: true, isShowDays: false); + + return timer; + } +} From ecb600c4fc0075b8f4e137d15f73aa14f7e846a2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 17:49:46 +0300 Subject: [PATCH 046/124] 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 72966c32695e737e95fddc51e9f1dd295b4b7456 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 8 Jun 2021 13:05:08 +0300 Subject: [PATCH 047/124] fix referral patient services --- lib/config/config.dart | 8 +- .../referral/MyReferralPatientModel.dart | 4 +- .../MyReferralPatientRequestModel.dart | 104 +++++++++++++ .../patient/MyReferralPatientService.dart | 69 ++++----- .../patient-doctor-referral-service.dart | 3 +- .../viewModel/patient-referral-viewmodel.dart | 12 +- .../my_referred_patient_model.dart | 2 +- .../my-referral-inpatient-screen.dart | 141 +++++++++++------- .../referral_patient_detail_in-paint.dart | 13 +- .../referred_patient_detail_in-paint.dart | 11 +- lib/util/date-utils.dart | 18 +++ 11 files changed, 270 insertions(+), 115 deletions(-) create mode 100644 lib/core/model/referral/MyReferralPatientRequestModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 91f8bc9d..e2f9eb6a 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"; @@ -56,7 +56,7 @@ const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddRefe const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient'; +const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; @@ -181,7 +181,7 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUTPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferredOutPatient"; +const GET_MY_REFERRAL_OUTPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 797109dd..7aa375b8 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -158,8 +158,8 @@ class MyReferralPatientModel { referringDoctor = json['ReferringDoctor']; referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; - referralStatus = json['ReferralStatus']; - referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); + referralStatus = json["ReferralStatus"] is String ?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0: json["ReferralStatus"]; + referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']); referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; diff --git a/lib/core/model/referral/MyReferralPatientRequestModel.dart b/lib/core/model/referral/MyReferralPatientRequestModel.dart new file mode 100644 index 00000000..08b98a99 --- /dev/null +++ b/lib/core/model/referral/MyReferralPatientRequestModel.dart @@ -0,0 +1,104 @@ +class MyReferralPatientRequestModel { + int channel; + int clinicID; + int doctorID; + int editedBy; + String firstName; + String from; + String iPAdress; + bool isLoginForDoctorApp; + int languageID; + String lastName; + String middleName; + int patientID; + String patientIdentificationID; + String patientMobileNumber; + bool patientOutSA; + int patientTypeID; + int projectID; + String sessionID; + String stamp; + String to; + String tokenID; + double versionID; + String vidaAuthTokenID; + + MyReferralPatientRequestModel( + {this.channel, + this.clinicID, + this.doctorID, + this.editedBy, + this.firstName, + this.from, + this.iPAdress, + this.isLoginForDoctorApp, + this.languageID, + this.lastName, + this.middleName, + this.patientID, + this.patientIdentificationID, + this.patientMobileNumber, + this.patientOutSA, + this.patientTypeID, + this.projectID, + this.sessionID, + this.stamp, + this.to, + this.tokenID, + this.versionID, + this.vidaAuthTokenID}); + + MyReferralPatientRequestModel.fromJson(Map json) { + channel = json['Channel']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; + firstName = json['FirstName']; + from = json['From']; + iPAdress = json['IPAdress']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + languageID = json['LanguageID']; + lastName = json['LastName']; + middleName = json['MiddleName']; + patientID = json['PatientID']; + patientIdentificationID = json['PatientIdentificationID']; + patientMobileNumber = json['PatientMobileNumber']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + projectID = json['ProjectID']; + sessionID = json['SessionID']; + stamp = json['stamp']; + to = json['To']; + tokenID = json['TokenID']; + versionID = json['VersionID']; + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['Channel'] = this.channel; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + data['FirstName'] = this.firstName; + data['From'] = this.from; + data['IPAdress'] = this.iPAdress; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['LanguageID'] = this.languageID; + data['LastName'] = this.lastName; + data['MiddleName'] = this.middleName; + data['PatientID'] = this.patientID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + data['ProjectID'] = this.projectID; + data['SessionID'] = this.sessionID; + data['stamp'] = this.stamp; + data['To'] = this.to; + data['TokenID'] = this.tokenID; + data['VersionID'] = this.versionID; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 05a937ee..9f29c4dc 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; @@ -8,22 +9,22 @@ class MyReferralInPatientService extends BaseService { Future getMyReferralPatientService() async { hasError = false; - Map body = Map(); await getDoctorProfile(); - body['DoctorID'] = doctorProfile.doctorID; - body['FirstName'] = "0"; - body['MiddleName'] = "0"; - body['LastName'] = "0"; - body['PatientMobileNumber'] = "0"; - body['PatientIdentificationID'] = "0"; - body['PatientID'] = 0; - body['From'] = "0"; - body['To'] = "0"; - body['stamp'] = DateTime.now().toIso8601String(); - body['IsLoginForDoctorApp'] = true; - body['IPAdress'] = "11.11.11.11"; - body['PatientOutSA'] = false; - body['PatientTypeID'] = 1; + + MyReferralPatientRequestModel myReferralPatientRequestModel = + MyReferralPatientRequestModel( + doctorID: doctorProfile.doctorID, + firstName: "0", + middleName: "0", + lastName: "0", + patientMobileNumber: "0", + patientIdentificationID: "0", + patientID: 0, + from: "0", + to: "0", + stamp: DateTime.now().toIso8601String(), + isLoginForDoctorApp: true, + patientTypeID: 1); myReferralPatients.clear(); await baseAppClient.post( GET_MY_REFERRAL_INPATIENT, @@ -38,34 +39,34 @@ class MyReferralInPatientService extends BaseService { hasError = true; super.error = error; }, - body: body, + body: myReferralPatientRequestModel.toJson(), ); } Future getMyReferralOutPatientService() async { hasError = false; - Map body = Map(); await getDoctorProfile(); - body['DoctorID'] = doctorProfile.doctorID; - body['FirstName'] = "0"; - body['MiddleName'] = "0"; - body['LastName'] = "0"; - body['PatientMobileNumber'] = "0"; - body['PatientIdentificationID'] = "0"; - body['PatientID'] = 0; - body['From'] = "0"; - body['To'] = "0"; - body['stamp'] = DateTime.now().toIso8601String(); - body['IsLoginForDoctorApp'] = true; - body['IPAdress'] = "11.11.11.11"; - body['PatientOutSA'] = false; - body['PatientTypeID'] = 1; + + MyReferralPatientRequestModel myReferralPatientRequestModel = + MyReferralPatientRequestModel( + doctorID: doctorProfile.doctorID, + firstName: "0", + middleName: "0", + lastName: "0", + patientMobileNumber: "0", + patientIdentificationID: "0", + patientID: 0, + from: "0", + to: "0", + stamp: DateTime.now().toIso8601String(), + isLoginForDoctorApp: true, + patientTypeID: 1); myReferralPatients.clear(); await baseAppClient.post( GET_MY_REFERRAL_OUTPATIENT, onSuccess: (dynamic response, int statusCode) { - if (response['List_MyReferredOutPatient'] != null) { - response['List_MyReferredOutPatient'].forEach((v) { + if (response['List_MyOutPatientReferral'] != null) { + response['List_MyOutPatientReferral'].forEach((v) { myReferralPatients.add(MyReferralPatientModel.fromJson(v)); }); } @@ -74,7 +75,7 @@ class MyReferralInPatientService extends BaseService { hasError = true; super.error = error; }, - body: body, + body: myReferralPatientRequestModel.toJson(), ); } diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index c9126845..81529590 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -161,7 +161,6 @@ class PatientReferralService extends LookupService { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - // _requestMyReferralPatient.doctorID = 1002; DoctorProfileModel doctorProfile = await getDoctorProfile(); await baseAppClient.post( @@ -169,7 +168,7 @@ class PatientReferralService extends LookupService { onSuccess: (dynamic response, int statusCode) { listMyReferredPatientModel.clear(); - response['List_MyOutPatientReferral'].forEach((v) { + response['List_MyReferredOutPatient'].forEach((v) { MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); if (doctorProfile != null) { item.isReferralDoctorSameBranch = diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 6e3e310e..01d40e62 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -174,22 +174,22 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMyReferralPatientService() async { - setState(ViewState.Busy); + Future getMyReferralPatientService({bool localBusy = false}) async { + if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); await _myReferralService.getMyReferralPatientService(); if (_myReferralService.hasError) { error = _myReferralService.error; - setState(ViewState.Error); + if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMyReferralOutPatientService() async { - setState(ViewState.Busy); + Future getMyReferralOutPatientService({bool localBusy = false}) async { + if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); await _myReferralService.getMyReferralOutPatientService(); if (_myReferralService.hasError) { error = _myReferralService.error; - setState(ViewState.Error); + if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index 44a427f7..5a755fe8 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -166,7 +166,7 @@ class MyReferredPatientModel { referringDoctor = json['ReferringDoctor']; referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; - referralStatus = json['ReferralStatus']; + referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus'];// TODO Elham json['ReferralStatus']; referralDate = json['ReferralDate']; referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index 5665a30f..9813286e 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -1,16 +1,21 @@ +import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-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/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyReferralInPatientScreen extends StatelessWidget { + PatientType patientType = PatientType.IN_PATIENT; + @override Widget build(BuildContext context) { @@ -20,70 +25,90 @@ class MyReferralInPatientScreen extends StatelessWidget { baseViewModel: model, isShowAppBar: false, appBarTitle: TranslationBase.of(context).referPatient, - body: model.myReferralPatients.isEmpty - ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, + body: Column( + children: [ + + Container( + margin: EdgeInsets.only(top: 70), + child: PatientTypeRadioWidget( + (patientType) async { + this.patientType = patientType; + GifLoaderDialogUtils.showMyDialog(context); + if (patientType == PatientType.IN_PATIENT) { + await model.getMyReferralPatientService(localBusy: true); + } else { + await model.getMyReferralOutPatientService(localBusy: true); + } + GifLoaderDialogUtils.hideDialog(context); + }, + ), + ), + model.myReferralPatients.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).referralEmptyMsg, + color: Theme.of(context).errorColor, + ), + ) + ], ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ) - : SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(top: 70), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + ) + : SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ - ...List.generate( - model.myReferralPatients.length, - (index) => InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferralPatientDetailScreen(model.myReferralPatients[index],model), + ...List.generate( + model.myReferralPatients.length, + (index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralPatientDetailScreen(model.myReferralPatients[index],model), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context), + referralStatusCode: model.myReferralPatients[index].referralStatus, + patientName: model.myReferralPatients[index].patientName, + patientGender: model.myReferralPatients[index].gender, + referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), + referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), + patientID: "${model.myReferralPatients[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic:"${model.myReferralPatients[index].referringClinicDescription}", + remark: model.myReferralPatients[index].referringDoctorRemarks, + nationality: model.myReferralPatients[index].nationalityName, + nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, + doctorAvatar: model.myReferralPatients[index].doctorImageURL, + referralDoctorName: model.myReferralPatients[index].referringDoctorName, + clinicDescription: model.myReferralPatients[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), ), - ); - }, - child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context), - referralStatusCode: model.myReferralPatients[index].referralStatus, - patientName: model.myReferralPatients[index].patientName, - patientGender: model.myReferralPatients[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), - referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), - patientID: "${model.myReferralPatients[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic:"${model.myReferralPatients[index].referringClinicDescription}", - remark: model.myReferralPatients[index].referringDoctorRemarks, - nationality: model.myReferralPatients[index].nationalityName, - nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, - doctorAvatar: model.myReferralPatients[index].doctorImageURL, - referralDoctorName: model.myReferralPatients[index].referringDoctorName, - clinicDescription: model.myReferralPatients[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), + ), ), - ), + ], ), - ], + ), ), - ), - ), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index a949036b..0e7b214b 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -237,6 +237,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ], ), + if(referredPatient.frequency != null) Row( mainAxisAlignment: MainAxisAlignment.start, @@ -256,7 +257,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { Expanded( child: AppText( referredPatient - .frequencyDescription, + .frequencyDescription??'', fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * @@ -303,6 +304,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ) ], ), + if(referredPatient.priorityDescription != null) Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -317,7 +319,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - referredPatient.priorityDescription, + referredPatient.priorityDescription??'', fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -327,6 +329,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ], ), + if(referredPatient.mAXResponseTime != null) Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -342,9 +345,9 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - AppDateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime != null? AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + "dd MMM,yyyy"):'', fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -469,7 +472,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient.referringDoctorRemarks, + referredPatient.referringDoctorRemarks??'', fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index b4e1ddc5..b3f11c51 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -236,6 +236,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), + if(referredPatient + .frequencyDescription != null) Row( mainAxisAlignment: MainAxisAlignment.start, @@ -301,6 +303,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ) ], ), + if(referredPatient.priorityDescription != null) Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -322,6 +325,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), + if(referredPatient.mAXResponseTime != null) Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -337,9 +341,9 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - AppDateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime != null?AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + "dd MMM,yyyy"):'', fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -515,6 +519,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( referredPatient + .referredDoctorRemarks == null ?'':referredPatient .referredDoctorRemarks.isNotEmpty ? referredPatient.referredDoctorRemarks : TranslationBase.of(context).notRepliedYet, @@ -543,7 +548,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { fontSize: 1.8, hPadding: 8, vPadding: 12, - disabled: referredPatient.referredDoctorRemarks.isNotEmpty + disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks.isNotEmpty ? false : true, onPressed: () async { diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index a7d03076..2839c86f 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -371,4 +371,22 @@ class AppDateUtils { else return ""; } + + + // handel date like "09/05/2021 17:00" + static DateTime getDateTimeFromString(String str) { + List array = str.split('/'); + int day = int.parse(array[0]); + int month = int.parse(array[1]); + + List array2 = array[2].split(' '); + int year = int.parse(array2[0]); + String hour = array2[1]; + List hourList = hour.split(":"); + + DateTime date = DateTime(year, month, day, int.parse(hourList[0]), int.parse(hourList[1])); + + + return date; + } } From 3df6a55dadf9cd11f0ec96786ee0f5ee0d885257 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 8 Jun 2021 13:07:33 +0300 Subject: [PATCH 048/124] remove comment --- lib/models/patient/my_referral/my_referred_patient_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index 5a755fe8..cb61975a 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -166,7 +166,7 @@ class MyReferredPatientModel { referringDoctor = json['ReferringDoctor']; referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; - referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus'];// TODO Elham json['ReferralStatus']; + referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus']; referralDate = json['ReferralDate']; referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; From 9d6a23c1a3b1e4b876c1d63dc6bccfc7b734daac Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 8 Jun 2021 16:28:35 +0300 Subject: [PATCH 049/124] add NavigationService --- lib/client/base_app_client.dart | 6 +++++ lib/core/service/NavigationService.dart | 12 ++++++++++ lib/locator.dart | 32 +++++++++++++------------ lib/main.dart | 2 ++ 4 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 lib/core/service/NavigationService.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 10181bf4..b1785b0e 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -3,6 +3,7 @@ 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/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -12,6 +13,9 @@ import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; import 'package:provider/provider.dart'; +import '../locator.dart'; +import '../routes.dart'; + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); @@ -116,7 +120,9 @@ class BaseAppClient { await Provider.of(AppGlobal.CONTEX, listen: false) .logout(); + Helpers.showErrorToast('Your session expired Please login again'); + locator().pushNamedAndRemoveUntil(ROOT); } if (isAllowAny) { onFailure(getError(parsed), statusCode); diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart new file mode 100644 index 00000000..426ace4d --- /dev/null +++ b/lib/core/service/NavigationService.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class NavigationService { + final GlobalKey navigatorKey = + new GlobalKey(); + Future navigateTo(String routeName) { + return navigatorKey.currentState.pushNamed(routeName); + } + Future pushNamedAndRemoveUntil(String routeName) { + return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); + } +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 66ec9161..6147b114 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -8,35 +8,36 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/NavigationService.dart'; import 'core/service/home/dasboard_service.dart'; +import 'core/service/home/doctor_reply_service.dart'; +import 'core/service/home/schedule_service.dart'; +import 'core/service/hospitals/hospitals_service.dart'; import 'core/service/patient/DischargedPatientService.dart'; import 'core/service/patient/LiveCarePatientServices.dart'; -import 'core/service/patient/patient_service.dart'; -import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; import 'core/service/patient/MyReferralPatientService.dart'; import 'core/service/patient/PatientMuseService.dart'; import 'core/service/patient/ReferralService.dart'; +import 'core/service/patient/out_patient_service.dart'; +import 'core/service/patient/patient-doctor-referral-service.dart'; +import 'core/service/patient/patientInPatientService.dart'; +import 'core/service/patient/patient_service.dart'; +import 'core/service/patient/referral_patient_service.dart'; +import 'core/service/patient/referred_patient_service.dart'; +import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; +import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; +import 'core/service/patient_medical_file/lab_order/labs_service.dart'; import 'core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart'; import 'core/service/patient_medical_file/medical_report/medical_file_service.dart'; +import 'core/service/patient_medical_file/prescription/medicine_service.dart'; import 'core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'core/service/patient_medical_file/procedure/procedure_service.dart'; +import 'core/service/patient_medical_file/radiology/radiology_service.dart'; import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'core/service/patient_medical_file/soap/SOAP_service.dart'; -import 'core/service/home/doctor_reply_service.dart'; -import 'core/service/hospitals/hospitals_service.dart'; -import 'core/service/patient_medical_file/lab_order/labs_service.dart'; -import 'core/service/patient_medical_file/prescription/medicine_service.dart'; -import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; -import 'core/service/patient/patient-doctor-referral-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/patient/out_patient_service.dart'; -import 'core/service/patient/patientInPatientService.dart'; -import 'core/service/patient_medical_file/prescription/prescriptions_service.dart'; -import 'core/service/patient_medical_file/radiology/radiology_service.dart'; -import 'core/service/patient/referral_patient_service.dart'; -import 'core/service/patient/referred_patient_service.dart'; -import 'core/service/home/schedule_service.dart'; import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart'; @@ -92,6 +93,7 @@ void setupLocator() { locator.registerLazySingleton(() => HospitalsService()); locator.registerLazySingleton(() => PatientMedicalReportService()); locator.registerLazySingleton(() => LiveCarePatientServices()); + locator.registerLazySingleton(() => NavigationService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/main.dart b/lib/main.dart index a95378e5..c29429b0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,6 +11,7 @@ import 'package:provider/provider.dart'; import './config/size_config.dart'; import './routes.dart'; import 'config/config.dart'; +import 'core/service/NavigationService.dart'; import 'core/viewModel/authentication_view_model.dart'; import 'locator.dart'; @@ -66,6 +67,7 @@ class MyApp extends StatelessWidget { dividerColor: Colors.grey[350], backgroundColor: Color.fromRGBO(255, 255, 255, 1), ), + navigatorKey: locator().navigatorKey, initialRoute: INIT_ROUTE, routes: routes, debugShowCheckedModeBanner: false, From b1062dd5375f607ab4c257774519a09306ed5dcb Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 8 Jun 2021 17:09:41 +0300 Subject: [PATCH 050/124] fix merge issue --- lib/locator.dart | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/locator.dart b/lib/locator.dart index 67b09848..1c491b54 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -23,7 +23,6 @@ import 'core/service/patient/patient-doctor-referral-service.dart'; import 'core/service/patient/patientInPatientService.dart'; import 'core/service/patient/patient_service.dart'; import 'core/service/patient/referral_patient_service.dart'; -import 'core/service/patient/referred_patient_service.dart'; import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; import 'core/service/patient_medical_file/lab_order/labs_service.dart'; @@ -38,12 +37,6 @@ 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/patient/out_patient_service.dart'; -import 'core/service/patient/patientInPatientService.dart'; -import 'core/service/patient_medical_file/prescription/prescriptions_service.dart'; -import 'core/service/patient_medical_file/radiology/radiology_service.dart'; -import 'core/service/patient/referral_patient_service.dart'; -import 'core/service/home/schedule_service.dart'; import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart'; From 693f57a13e95f2f2d312dc18a2e1da49aab9860e Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Wed, 9 Jun 2021 12:53:40 +0300 Subject: [PATCH 051/124] Merge branch 'development' into ZohaibKambrani * development: (102 commits) prescription changes pescription changes fix imports project refactoring working on feature medical profile prescription changes hot fix hot fix hot fix refactoring hot fix hot fix add prescription form changes Add Medical Report Page hot fix hot fix add prescription changes fix in note and AddReplayOnReferralPatient Add Prescription changes prescription changes ... # Conflicts: # lib/screens/patients/DischargedPatientPage.dart # lib/screens/patients/ReferralDischargedPatientDetails.dart # lib/screens/patients/insurance_approvals_details.dart # lib/screens/patients/patients_screen.dart # lib/screens/patients/profile/note/progress_note_screen.dart # lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart # lib/screens/prescription/update_prescription_form.dart # lib/screens/sick-leave/add-sickleave.dart # lib/widgets/patients/PatientCard.dart # pubspec.lock --- ios/Podfile.lock | 327 ----------- ios/Runner.xcodeproj/project.pbxproj | 44 +- ios/Runner/AppDelegate.swift | 31 +- ios/Runner/Assets.xcassets/Contents.json | 6 +- .../end_call.imageset/Contents.json | 21 + .../end_call.imageset/end_call.png | Bin 0 -> 21324 bytes .../expand_video.imageset/Contents.json | 21 + .../expand_video.imageset/expand.png | Bin 0 -> 5366 bytes .../float_video.imageset/Contents.json | 21 + .../float_video.imageset/Group 8024.png | Bin 0 -> 4953 bytes .../mic_mute.imageset/Contents.json | 21 + .../mic_mute.imageset/mic_mute.png | Bin 0 -> 6537 bytes .../mic_unmute.imageset/Contents.json | 21 + .../mic_unmute.imageset/Group 8020.png | Bin 0 -> 5904 bytes .../video_mute.imageset/Contents.json | 21 + .../video_mute.imageset/video_mute.png | Bin 0 -> 6438 bytes .../video_unmute.imageset/Contents.json | 21 + .../video_unmute.imageset/Group 8022.png | Bin 0 -> 5715 bytes ios/Runner/Base.lproj/Main.storyboard | 515 ++++++++++++------ ios/Runner/MainAppViewController.swift | 142 +++++ ios/Runner/VCEmbeder.swift | 71 +++ ios/Runner/VideoCallRequestParameters.swift | 27 + ...er.swift => VideoCallViewController.swift} | 177 +++--- lib/client/base_app_client.dart | 2 +- .../patient_profile_screen.dart | 102 ++-- pubspec.lock | 6 +- 26 files changed, 950 insertions(+), 647 deletions(-) delete mode 100644 ios/Podfile.lock create mode 100644 ios/Runner/Assets.xcassets/end_call.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/end_call.imageset/end_call.png create mode 100644 ios/Runner/Assets.xcassets/expand_video.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/expand_video.imageset/expand.png create mode 100644 ios/Runner/Assets.xcassets/float_video.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/float_video.imageset/Group 8024.png create mode 100644 ios/Runner/Assets.xcassets/mic_mute.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/mic_mute.imageset/mic_mute.png create mode 100644 ios/Runner/Assets.xcassets/mic_unmute.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/mic_unmute.imageset/Group 8020.png create mode 100644 ios/Runner/Assets.xcassets/video_mute.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/video_mute.imageset/video_mute.png create mode 100644 ios/Runner/Assets.xcassets/video_unmute.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/video_unmute.imageset/Group 8022.png create mode 100644 ios/Runner/MainAppViewController.swift create mode 100644 ios/Runner/VCEmbeder.swift create mode 100644 ios/Runner/VideoCallRequestParameters.swift rename ios/Runner/{VideoViewController.swift => VideoCallViewController.swift} (84%) diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 44151727..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.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f0784432..0e446318 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -9,12 +9,15 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 29211E4225C172B700DD740D /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 29211E4125C172B700DD740D /* GoogleService-Info.plist */; }; + 300790FA266FB14B0052174C /* VCEmbeder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 300790F9266FB14B0052174C /* VCEmbeder.swift */; }; + 30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; }; + 30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 9CE61EBD24AB366E008D68DD /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61EBC24AB366E008D68DD /* VideoViewController.swift */; }; + 9CE61EBD24AB366E008D68DD /* VideoCallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */; }; 9CE61ECD24ADBB4C008D68DD /* ICallProtocoll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */; }; B650DC3076E9D70CB188286A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -37,6 +40,9 @@ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = ""; }; 29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = ""; }; + 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = ""; }; + 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallRequestParameters.swift; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -50,7 +56,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9CE61EBC24AB366E008D68DD /* VideoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoViewController.swift; sourceTree = ""; }; + 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallViewController.swift; sourceTree = ""; }; 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = ""; }; 9D4B7DB43C6A6C849D2387CE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; E698D7B14B12DF768FE47A1A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; @@ -68,6 +74,30 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 300790F8266FB0F10052174C /* helpers */ = { + isa = PBXGroup; + children = ( + 300790F9266FB14B0052174C /* VCEmbeder.swift */, + ); + name = helpers; + sourceTree = ""; + }; + 30F70E6A266F56C9005D8F8E /* controllers */ = { + isa = PBXGroup; + children = ( + 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */, + ); + name = controllers; + sourceTree = ""; + }; + 30F70E6D266F64F8005D8F8E /* Models */ = { + isa = PBXGroup; + children = ( + 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */, + ); + name = Models; + sourceTree = ""; + }; 7D66D387293CE5376A07EC5F /* Pods */ = { isa = PBXGroup; children = ( @@ -111,6 +141,9 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 300790F8266FB0F10052174C /* helpers */, + 30F70E6D266F64F8005D8F8E /* Models */, + 30F70E6A266F56C9005D8F8E /* controllers */, 29211E4125C172B700DD740D /* GoogleService-Info.plist */, 29211CD725C165D600DD740D /* RunnerRelease.entitlements */, 97C146FA1CF9000F007C117D /* Main.storyboard */, @@ -122,7 +155,7 @@ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - 9CE61EBC24AB366E008D68DD /* VideoViewController.swift */, + 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */, 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */, ); path = Runner; @@ -290,10 +323,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 300790FA266FB14B0052174C /* VCEmbeder.swift in Sources */, + 30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 9CE61EBD24AB366E008D68DD /* VideoViewController.swift in Sources */, + 9CE61EBD24AB366E008D68DD /* VideoCallViewController.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 9CE61ECD24ADBB4C008D68DD /* ICallProtocoll.swift in Sources */, + 30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index b97c7000..dc938e36 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -22,34 +22,8 @@ import OpenTok _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - let controller : FlutterViewController = window?.rootViewController as! FlutterViewController - let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall", - binaryMessenger: controller.binaryMessenger) - videoCallChannel.setMethodCallHandler({ - (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in - self.result = result - switch call.method { - case "openVideoCall": - do { - let arguments = call.arguments as? NSDictionary - let kApiKey = arguments!["kApiKey"] as? String - let kSessionId = arguments!["kSessionId"] as? String - let kToken = arguments!["kToken"] as? String - let appLang = arguments!["appLang"] as? String - let vC_ID = arguments!["VC_ID"] as? Int - let tokenID = arguments!["TokenID"] as? String - let generalId = arguments!["generalId"] as? String - let doctorId = arguments!["DoctorId"] as? Int - let baseUrl = arguments!["baseUrl"] as? String - - self.openVideoChat(result: result,kApiKey: kApiKey!,kSessionId:kSessionId!,kToken: kToken!, appLang: appLang!, vC_ID: vC_ID!,tokenID: tokenID!,generalId: generalId!,doctorId: doctorId!, baseUrl: baseUrl!) - } - default: - result(FlutterMethodNotImplemented) - } - }) - GeneratedPluginRegistrant.register(with: self) + GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } @@ -61,7 +35,7 @@ import OpenTok let storyboard = UIStoryboard(name: "Main", bundle: nil) let identifier = "ViewControllerNav" let navVC = storyboard.instantiateViewController(withIdentifier: identifier) as! UINavigationController - let videoVC = navVC.viewControllers.first as! ViewController + let videoVC = navVC.viewControllers.first as! VideoCallViewController videoVC.kApiKey=kApiKey videoVC.kSessionId=kSessionId videoVC.kToken=kToken @@ -78,3 +52,4 @@ import OpenTok } } + diff --git a/ios/Runner/Assets.xcassets/Contents.json b/ios/Runner/Assets.xcassets/Contents.json index da4a164c..73c00596 100755 --- a/ios/Runner/Assets.xcassets/Contents.json +++ b/ios/Runner/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/ios/Runner/Assets.xcassets/end_call.imageset/Contents.json b/ios/Runner/Assets.xcassets/end_call.imageset/Contents.json new file mode 100644 index 00000000..3762a5af --- /dev/null +++ b/ios/Runner/Assets.xcassets/end_call.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "end_call.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/end_call.imageset/end_call.png b/ios/Runner/Assets.xcassets/end_call.imageset/end_call.png new file mode 100644 index 0000000000000000000000000000000000000000..52f8e267234d686e31be8a6e1b44287ab98364db GIT binary patch literal 21324 zcmYg&bzGD0_cxmphKMi_DG?;4LkY>zB}jJ((k0z7R63=5(hZW*7<3~g-5t^mznl1c zpXZOgfN|}4~QP1prBw%N{A?+pnz7cUrR_#Rp1XULp4bw85tBh;CCnr$j=l7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hUi35*m67Tz8tKw z+OgLSP1a!SLI8`0V4l?BEcWu|>YJlWxG}kt$`=!nwb+;AeS|9r)7}RCC$-pF$9nye z8ft|C{I1-|$8}T7u{&Eup=#PMIV+W+?k>&;B8o)I%4b=r5PH;u_qcO6F9E>Dnd zCT)^8{)vm_y1XU`?S}uYcZtz34=~kkE3Umc%^nrsb_mUnnKAAilE$(DkFkM;ew7|3 F@_+AV*hT;V literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/expand_video.imageset/Contents.json b/ios/Runner/Assets.xcassets/expand_video.imageset/Contents.json new file mode 100644 index 00000000..1ecfeae9 --- /dev/null +++ b/ios/Runner/Assets.xcassets/expand_video.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "expand.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/expand_video.imageset/expand.png b/ios/Runner/Assets.xcassets/expand_video.imageset/expand.png new file mode 100644 index 0000000000000000000000000000000000000000..7020dc2ef8e2f6f35465c65c06836422cda0fd91 GIT binary patch literal 5366 zcmX|FcTf{dun!?%2qGc$P)s05=!i&>nh=E0B!cu_6e&`q_t1L@O^Oge1O%l?Q+kym zMnyn+3sMyUv4HaU-pqS{?Csv(?%d7p?C#Ak(a=DP2?B=z001VuHtzO0A3djGF#Y*z zb~5gN&S)Oq*1`f_Oz>`ls%&0Kn#s$6<^EY4)rcGx#*w!)RpH(5hG9&>3wV?J^)-96xe}pkt1q1sSR~ z)>c4uAhK1V;$*{UOj%qu2UjVZ9QjmEv)T?z$e zckeBY7v@i2`*`i)gHH>^Tlrfd-?mie77n-M%dX(riM_qOop#HSaa}xH4=C2~S55ck z*7u0Yqq-DRjU#s66D40h-@ODD!D05F1c&L|7rfZh1zSh$a`am(=<-M@Q9Ho{CF?jSD3yXR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l>|;?51U zEY045Gxar?NYBhQw3E`|MO+*zygCtX5`38>&~h;Yp?jZvaUuk1zaD2V4!avau~Y^! zB=19X;;Z^zLx|o&7C)Gji#_G%+^fujJ?ylnmKXGf;-UE%1M2mXfiS5dtGubHH^8T6 zC22Lw*oiwF!hn`t>_!fK(2t1C%&y)6VTs zGFVXE1eIz_vBA1P^x}Bwd_D08xM~0${N>PDCF!R<^9C5^@0>y zf)*N_t(>apcvj-zTe*5ly;b8AX-R8#gl_Lnbb3pcWBN5D(LP&OdxNLlhDMY*t{vgq zak7CS@Ow@*Jtx9y67=U}7LzaYq&WxblGzJpl4emZ2bE*eC*8ts#w4<;G1@1q^-QnL z>Yw8VEL~Ds&eLl>U)U0h`Ie~;Xo(%xK3QB?cEJL%;)5$kb$0DML{fXO%|d-!a* zSM>_9m!$SX2A&SAE8l&#`Fbe@m(>hZ5T%!7+AVt5G9i4xM~>?Oi0$ZA54X3D z@!im&`C>*s{-AXllwJ*CxOqagpDZ1cVa-thU&^I5p9K{(qQ)1 zzOVJ}S67<~dVF*<@N1-^Z{B~it44XZUjbF(J;-$-)!H`+(sw#EdL?e4dr2(9tI~0R zFjRp#_<%*hp!9arNyE6gQ~}|F;ldr6GPjQ^&|{oEW4P0tyg6T0-QP1)kzeTilj-39 PzPNO?j5Ob>+lTxQOg$37 literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/mic_mute.imageset/Contents.json b/ios/Runner/Assets.xcassets/mic_mute.imageset/Contents.json new file mode 100644 index 00000000..2a0f4d2e --- /dev/null +++ b/ios/Runner/Assets.xcassets/mic_mute.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "mic_mute.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/Runner/Assets.xcassets/mic_mute.imageset/mic_mute.png b/ios/Runner/Assets.xcassets/mic_mute.imageset/mic_mute.png new file mode 100644 index 0000000000000000000000000000000000000000..266cb6c72418b5aba18b32c421c2b4e75f05e47e GIT binary patch literal 6537 zcmX{*cQ_l|*AbBhLF_1v2r4m3tkRZBtWY!d-bL+Mdym+$wbUr8R_RcC2c@dKt+yHlF@J~++ zP+qyI<|A39C`(mH;e=MRRLEx{Zus&p@ZsfjCt=oM7hYcRC$Dbt$i@xD-2lVF(d7N^ zMY-8_zq?ECqJMw>>+r+yZpB#a)alge#?89li+hSG1T>^fHM)xv$`&`L7KxKi3VmVx z$mK-SXd-6IX{%}_cT<;d4(OBMo8;^9?$H~ZfF@9@Qh(q$(2X^*;>3<_o!b8_Y)!e1 zU!LhhGM>QExCihw&^C^jEE1y7rW=t%Rs>auwZ(gDf$Qq|=p&KWl`NWnU>eG4LF_D` zB={9%Z6@T36h?#5SX{_8o!7Z!fa;kGonJi)^-y_nT|VO(f0i}i!3Dd^Uus@tB*O=) z2`M)RG2{OHM{JehdA%OH{6=|eDne;aYejJ6@KqUzZ_-8~)T67pMCZFI;d`M^L*|8z z^mCN**4xr5kzva%1|xQNkTvYb<$`k8fO0|}zjGXy@Jwe8-Y+3NOq&`@UdNED2P5Z> z)?dkE)lyz=_ zFraArm*Lfc#H}!KY2^!sZE-MO^}qC4mOySIWxiC!_{jNapP|UjRr(MEg`I%GR4L6d-Q_-tXdl7<3rdjvyx0?dabKV zg)m={vsHfz87!>eY@Xr}XgxPn;f{UKW zRvypGgOO29xr)ak^)xtgUznni z&LkNB0lm^fRq2EDqhm!yir^#l?`%BG1!MK|Z5g#4<+d#<-q)L<>WIh@2cZ0w)?_Y5 z!Ov!<`=zg5*U$bjTYyM;J-ne6uq}U~xmW51PsXwcN=C4->#B}PBLzlZv&H1!(RR8m za$NQv6AbFW99$-^9!}r-2aRN>05Bbet19Tvjf5C>YS*e3*+qL1MlpbrA4;nsF;{Z< zp_rTO5N~ZMLiW;_RjDQK5|UxxrzMUFvm(GSE?(;5q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AAsEzWR^lzHa9K-k|B@AWtsYLrz!}?pQht3#%7=L& zKcl4TC9s5mkFwv>6&f#TDv-4#nN%BjG={ScIr(EiB#;4&D5t570-{DB&>;)cVt z{KFjiPhy#U`}so^Q-NuiE(t|cvTM<08~)~Vo>&i{>o0T{F?s#?!A;eUyD Becu28 literal 0 HcmV?d00001 diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index 73e18f76..17833007 100755 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -1,16 +1,16 @@ - + - + - + - + @@ -23,12 +23,12 @@ - + - + - + @@ -37,252 +37,451 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + - + + + + - + + @@ -292,5 +491,7 @@ + + diff --git a/ios/Runner/MainAppViewController.swift b/ios/Runner/MainAppViewController.swift new file mode 100644 index 00000000..c6466343 --- /dev/null +++ b/ios/Runner/MainAppViewController.swift @@ -0,0 +1,142 @@ +// +// MainAppViewController.swift +// Runner +// +// Created by Zohaib Iqbal Kambrani on 08/06/2021. +// Copyright © 2021 The Chromium Authors. All rights reserved. +// + +import Foundation + +class MainAppViewController: FlutterViewController{ + var videoCallContainer:UIView! + var videoCallViewController:VideoCallViewController! + var videoCallFlutterResult:FlutterResult? + var vdoCallViewMinConstraint:[NSLayoutConstraint]! + var vdoCallViewMaxConstraint:[NSLayoutConstraint]! + + + override func viewDidLoad() { + super.viewDidLoad() + initFlutterBridge() + prepareVideoCallView() + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + } + + private func initFlutterBridge(){ + let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall", binaryMessenger: binaryMessenger) + videoCallChannel.setMethodCallHandler({ + (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in + switch call.method { + case "openVideoCall": + self.startVideoCall(result: result, call: call) + default: + result(FlutterMethodNotImplemented) + } + }) + } + +} + + +// Video Call Functions +extension MainAppViewController : ICallProtocol{ + + func prepareVideoCallView(){ + videoCallContainer = UIView(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: view.bounds.height)) + videoCallContainer.alpha = 0.0 + videoCallContainer.backgroundColor = UIColor.black + view.addSubview(videoCallContainer) + setVideoViewConstrints() + NSLayoutConstraint.activate(vdoCallViewMaxConstraint) + NSLayoutConstraint.deactivate(vdoCallViewMinConstraint) + + ViewEmbedder.embed( + withIdentifier: "videoCall", // Storyboard ID + parent: self, + container: self.videoCallContainer){ vc in + self.videoCallViewController = vc as? VideoCallViewController + + } + } + + private func startVideoCall(result: @escaping FlutterResult, call:FlutterMethodCall) { + videoCallFlutterResult = result + + if let arguments = call.arguments as? NSDictionary{ + showVideoCallView(true) + + videoCallViewController.onMinimize = { min in + self.minimizeVideoCall(min) + } + videoCallViewController.onClose = videoCallClosed + videoCallViewController.callBack = self + videoCallViewController.start(params: VideoCallRequestParameters(dictionary: arguments)) + } + + + } + + private func minimizeVideoCall(_ value:Bool){ + UIView.animate(withDuration: 0.5) { + if(value){ + NSLayoutConstraint.deactivate(self.vdoCallViewMaxConstraint) + NSLayoutConstraint.activate(self.vdoCallViewMinConstraint) + }else{ + NSLayoutConstraint.deactivate(self.vdoCallViewMinConstraint) + NSLayoutConstraint.activate(self.vdoCallViewMaxConstraint) + } + self.videoCallContainer.layer.cornerRadius = value ? 10 : 0 + self.videoCallContainer.layer.borderColor = value ? UIColor.white.cgColor : nil + self.videoCallContainer.layer.borderWidth = value ? 2 : 0 + self.view.layoutIfNeeded() + } + } + + private func showVideoCallView(_ value:Bool){ + UIView.animate(withDuration: 0.5) { + self.videoCallContainer.alpha = value ? 1.0 : 0.0 + } completion: { complete in + if(value == false){ + self.videoCallContainer.removeFromSuperview() + } + } + } + + private func videoCallClosed(){ + showVideoCallView(false) + } + + func sessionDone(res: Any) { + videoCallFlutterResult?(res) + } + + func sessionNotResponded(res: Any) { + videoCallFlutterResult?(res) + } + + + func setVideoViewConstrints(){ + let screen = UIScreen.main.bounds + + + videoCallContainer.translatesAutoresizingMaskIntoConstraints = false + + vdoCallViewMinConstraint = [ + videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor, constant: 20), + videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20), + videoCallContainer.widthAnchor.constraint(equalToConstant: screen.width/3), + videoCallContainer.heightAnchor.constraint(equalToConstant: screen.height/3.5) + ] + vdoCallViewMaxConstraint = [ + videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor), + videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor), + videoCallContainer.widthAnchor.constraint(equalToConstant: screen.width), + videoCallContainer.heightAnchor.constraint(equalToConstant: screen.height) + ] + } + +} diff --git a/ios/Runner/VCEmbeder.swift b/ios/Runner/VCEmbeder.swift new file mode 100644 index 00000000..e86dde75 --- /dev/null +++ b/ios/Runner/VCEmbeder.swift @@ -0,0 +1,71 @@ +// +// VCEmbeder.swift +// Runner +// +// Created by Zohaib Iqbal Kambrani on 08/06/2021. +// Copyright © 2021 The Chromium Authors. All rights reserved. +// + +import Foundation + +extension UIView { + func fill(to parent: UIView) { + topAnchor.constraint(equalTo: parent.topAnchor).isActive = true + leadingAnchor.constraint(equalTo: parent.leadingAnchor).isActive = true + bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true + trailingAnchor.constraint(equalTo: parent.trailingAnchor).isActive = true + } + + func fillToParent() { + if let parent = self.superview{ + topAnchor.constraint(equalTo: parent.topAnchor).isActive = true + leadingAnchor.constraint(equalTo: parent.leadingAnchor).isActive = true + bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true + trailingAnchor.constraint(equalTo: parent.trailingAnchor).isActive = true + } + } + + func fillTo(view:UIView) { + view.addSubview(self) + fill(to: view) + } +} + +class ViewEmbedder { + class func embed( + parent:UIViewController, + container:UIView, + child:UIViewController, + previous:UIViewController?){ + + if let previous = previous { + removeFromParent(vc: previous) + } + child.willMove(toParent: parent) + parent.addChild(child) + container.addSubview(child.view) + child.didMove(toParent: parent) + let w = container.frame.size.width; + let h = container.frame.size.height; + child.view.frame = CGRect(x: 0, y: 0, width: w, height: h) + + child.view.fill(to: container) + } + + class func removeFromParent(vc:UIViewController){ + vc.willMove(toParent: nil) + vc.view.removeFromSuperview() + vc.removeFromParent() + } + + class func embed(withIdentifier id:String, parent:UIViewController, container:UIView, completion:((UIViewController)->Void)? = nil){ + let vc = parent.storyboard!.instantiateViewController(withIdentifier: id) + embed( + parent: parent, + container: container, + child: vc, + previous: parent.children.first + ) + completion?(vc) + } +} diff --git a/ios/Runner/VideoCallRequestParameters.swift b/ios/Runner/VideoCallRequestParameters.swift new file mode 100644 index 00000000..2366c562 --- /dev/null +++ b/ios/Runner/VideoCallRequestParameters.swift @@ -0,0 +1,27 @@ + + +import Foundation + +class VideoCallRequestParameters{ + var apiKey:String? + var sessionId:String? + var token:String? + var lang:String? + var vcId:Int? + var tokenId:String? + var generalId:String? + var doctorId:Int? + var baseUrl:String? + + init(dictionary:NSDictionary){ + self.apiKey = dictionary["kApiKey"] as? String + self.sessionId = dictionary["kSessionId"] as? String + self.token = dictionary["kToken"] as? String + self.lang = dictionary["appLang"] as? String + self.vcId = dictionary["VC_ID"] as? Int + self.tokenId = dictionary["TokenID"] as? String + self.generalId = dictionary["generalId"] as? String + self.doctorId = dictionary["DoctorId"] as? Int + self.baseUrl = dictionary["baseUrl"] as? String + } +} diff --git a/ios/Runner/VideoViewController.swift b/ios/Runner/VideoCallViewController.swift similarity index 84% rename from ios/Runner/VideoViewController.swift rename to ios/Runner/VideoCallViewController.swift index 44e45f3a..a05957c9 100644 --- a/ios/Runner/VideoViewController.swift +++ b/ios/Runner/VideoCallViewController.swift @@ -11,7 +11,7 @@ import OpenTok import Alamofire -class ViewController: UIViewController { +class VideoCallViewController: UIViewController { var session: OTSession? var publisher: OTPublisher? @@ -34,18 +34,104 @@ class ViewController: UIViewController { var seconds = 30 var isUserConnect : Bool = false + var onMinimize:((Bool)->Void)? = nil + var onClose:(()->Void)? = nil + + // Bottom Actions + @IBOutlet weak var actionsHeightConstraint: NSLayoutConstraint! + @IBOutlet weak var videoMuteBtn: UIButton! + @IBOutlet weak var micMuteBtn: UIButton! + + @IBOutlet weak var localvideoTopMargin: NSLayoutConstraint! + @IBOutlet weak var localVideo: UIView! + @IBOutlet weak var remoteVideo: UIView! + @IBOutlet weak var controlButtons: UIView! + @IBOutlet weak var remoteVideoMutedIndicator: UIImageView! + @IBOutlet weak var localVideoMutedBg: UIView! override func viewDidLoad() { - super.viewDidLoad() + super.viewDidLoad() + localVideo.layer.borderColor = UIColor.white.cgColor + } + + @IBAction func didClickMuteButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + publisher!.publishAudio = !sender.isSelected - setupButtons() - askForMicrophonePermission() - requestCameraPermissionsIfNeeded() - hideVideoMuted() - setupSession() - - } + } + @IBAction func didClickSpeakerButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + subscriber?.subscribeToAudio = !sender.isSelected + // resetHideButtonsTimer() + } + + @IBAction func didClickVideoMuteButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + if publisher!.publishVideo { + publisher!.publishVideo = false + } else { + publisher!.publishVideo = true + } + localVideo.isHidden = sender.isSelected + localVideoMutedBg.isHidden = !sender.isSelected + // resetHideButtonsTimer() + + } + + + @IBAction func didClickSwitchCameraButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + if sender.isSelected { + publisher!.cameraPosition = AVCaptureDevice.Position.front + } else { + publisher!.cameraPosition = AVCaptureDevice.Position.back + } + /// resetHideButtonsTimer() + } + + @IBAction func hangUp(_ sender: UIButton) { + callBack?.sessionDone(res:["callResponse":"CallEnd"]) + sessionDisconnect() + } + + var minimized = false + @IBAction func onMinimize(_ sender: UIButton) { + minimized = !minimized + sender.isSelected = minimized + onMinimize?(minimized) + + self.videoMuteBtn.isHidden = minimized + self.micMuteBtn.isHidden = minimized + + let min_ = minimized + UIView.animate(withDuration: 1) { + self.actionsHeightConstraint.constant = min_ ? 30 : 60 + self.localvideoTopMargin.constant = min_ ? 20 : 40 + + let vdoBound = self.localVideo.bounds + self.publisher?.view?.frame = CGRect(x: 0, y: 0, width: vdoBound.size.width, height: vdoBound.size.height) + self.publisher?.view?.layoutIfNeeded() + } + } + + func start(params:VideoCallRequestParameters){ + + self.kApiKey = params.apiKey ?? "" + self.kSessionId = params.sessionId ?? "" + self.kToken = params.token ?? "" + self.VC_ID = params.vcId ?? 0 + self.generalid = params.generalId ?? "" + self.TokenID = params.tokenId ?? "" + self.DoctorId = params.doctorId ?? 0 + self.baseUrl = params.baseUrl ?? "" + + setupButtons() + askForMicrophonePermission() + requestCameraPermissionsIfNeeded() + hideVideoMuted() + setupSession() + } private func changeCallStatus(callStatus:Int){ let URL_USER_REGISTER = baseUrl+"LiveCareApi/DoctorApp/ChangeCallStatus" @@ -137,59 +223,15 @@ class ViewController: UIViewController { // display a useful message asking the user to grant permissions from within Settings > Privacy > Camera } - - @IBAction func didClickMuteButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - publisher!.publishAudio = !sender.isSelected - - } - - @IBAction func didClickSpeakerButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - subscriber?.subscribeToAudio = !sender.isSelected - // resetHideButtonsTimer() - } - - @IBAction func didClickVideoMuteButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - if publisher!.publishVideo { - publisher!.publishVideo = false - } else { - publisher!.publishVideo = true - } - localVideo.isHidden = sender.isSelected - localVideoMutedBg.isHidden = !sender.isSelected - localVideoMutedIndicator.isHidden = !sender.isSelected - // resetHideButtonsTimer() - - } - - - @IBAction func didClickSwitchCameraButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - if sender.isSelected { - publisher!.cameraPosition = AVCaptureDevice.Position.front - } else { - publisher!.cameraPosition = AVCaptureDevice.Position.back - } - /// resetHideButtonsTimer() - } - - @IBAction func hangUp(_ sender: UIButton) { - callBack?.sessionDone(res:["callResponse":"CallEnd"]) - sessionDisconnect() - } - - func sessionDisconnect() { changeCallStatus(callStatus: 16) if (session != nil) { print("disconnecting....") session!.disconnect(nil) dismiss(animated: true) - return } dismiss(animated: true) + onClose?() } func requestCameraPermissionsIfNeeded() { @@ -226,7 +268,6 @@ class ViewController: UIViewController { func hideVideoMuted() { remoteVideoMutedIndicator.isHidden = true localVideoMutedBg.isHidden = true - localVideoMutedIndicator.isHidden = true } func setupSession() { @@ -267,19 +308,6 @@ class ViewController: UIViewController { - @IBOutlet weak var localVideo: UIView! - - @IBOutlet weak var remoteVideo: UIView! - - @IBOutlet weak var controlButtons: UIView! - - @IBOutlet weak var remoteVideoMutedIndicator: UIImageView! - - @IBOutlet weak var localVideoMutedBg: UIImageView! - - - @IBOutlet weak var localVideoMutedIndicator: UIImageView! - @objc func updateTimer(){ seconds -= 1 //This will decrement(count down)the seconds. print(seconds) @@ -293,7 +321,7 @@ class ViewController: UIViewController { } -extension ViewController: OTSessionDelegate { +extension VideoCallViewController: OTSessionDelegate { func sessionDidConnect(_ session: OTSession) { print("The client connected to the OpenTok session.") @@ -301,7 +329,7 @@ extension ViewController: OTSessionDelegate { - timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: (#selector(ViewController.updateTimer)), userInfo: nil, repeats: true) + timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: (#selector(VideoCallViewController.updateTimer)), userInfo: nil, repeats: true) setupPublisher() @@ -318,9 +346,8 @@ extension ViewController: OTSessionDelegate { if error != nil { showAlert(error?.localizedDescription) } - - publisher?.view!.frame = CGRect(x: localVideo.bounds.origin.x, y: localVideo.bounds.origin.y, width: localVideo.bounds.size.width, height: localVideo.bounds.size.height) - + + publisher?.view!.frame = CGRect(x: 0, y: 0, width: localVideo.bounds.size.width, height: localVideo.bounds.size.height) localVideo.addSubview((publisher?.view)!) } @@ -408,7 +435,7 @@ extension ViewController: OTSessionDelegate { } -extension ViewController: OTPublisherDelegate { +extension VideoCallViewController: OTPublisherDelegate { func publisher(_ publisher: OTPublisherKit, didFailWithError error: OTError) { print("The publisher failed: \(error)") } @@ -420,7 +447,7 @@ extension ViewController: OTPublisherDelegate { } } -extension ViewController: OTSubscriberDelegate { +extension VideoCallViewController: OTSubscriberDelegate { public func subscriberDidConnect(toStream subscriber: OTSubscriberKit) { print("The subscriber did connect to the stream.") } diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 10181bf4..c011a4e1 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -109,7 +109,7 @@ class BaseAppClient { parsed['AndroidLink'], parsed['IOSLink']); } - if (!parsed['IsAuthenticated']) { + if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 55b2d6f9..30f53a0b 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -289,60 +289,64 @@ class _PatientProfileScreenState extends State EndCallScreen(patient:patient))); } else { GifLoaderDialogUtils.showMyDialog(context); - await model.startCall( isReCall : false, vCID: patient.vcId); + // await model.startCall( isReCall : false, vCID: patient.vcId); - if(model.state == ViewState.ErrorLocal) { - GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(model.error); - } else { - await model.getDoctorProfile(); - patient.appointmentNo = model.startCallRes.appointmentNo; - patient.episodeNo = 0; + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(model.error); + } else { + await model.getDoctorProfile(); + // patient.appointmentNo = model.startCallRes.appointmentNo; + patient.episodeNo = 0; - GifLoaderDialogUtils.hideDialog(context); - await VideoChannel.openVideoCallScreen( - kToken: model.startCallRes.openTokenID, - kSessionId: model.startCallRes.openSessionID, - kApiKey: '46209962', - vcId: patient.vcId, - tokenID: await model.getToken(), - generalId: GENERAL_ID, - doctorId: model.doctorProfile.doctorID, - onFailure: (String error) { - DrAppToastMsg.showErrorToast(error); - }, - onCallEnd: () { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(context); - model.endCall(patient.vcId, false,).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - setState(() { - isCallFinished = true; - }); - }); - }); - }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(context); - model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - setState(() { - isCallFinished = true; - }); - }); + GifLoaderDialogUtils.hideDialog(context); + await VideoChannel.openVideoCallScreen( + kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID, + kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",// model.startCallRes.openSessionID, + kApiKey: '47247954',//46209962 + vcId: patient.vcId, + tokenID: await model.getToken(), + generalId: GENERAL_ID, + doctorId: model.doctorProfile.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + }, + onCallEnd: () { + var asd=""; + // WidgetsBinding.instance.addPostFrameCallback((_) { + // GifLoaderDialogUtils.showMyDialog(context); + // model.endCall(patient.vcId, false,).then((value) { + // GifLoaderDialogUtils.hideDialog(context); + // if (model.state == ViewState.ErrorLocal) { + // DrAppToastMsg.showErrorToast(model.error); + // } + // setState(() { + // isCallFinished = true; + // }); + // }); + // }); + }, + onCallNotRespond: (SessionStatusModel sessionStatusModel) { + var asd=""; + // WidgetsBinding.instance.addPostFrameCallback((_) { + // GifLoaderDialogUtils.showMyDialog(context); + // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { + // GifLoaderDialogUtils.hideDialog(context); + // if (model.state == ViewState.ErrorLocal) { + // DrAppToastMsg.showErrorToast(model.error); + // } + // setState(() { + // isCallFinished = true; + // }); + // }); + // + // }); + }); - }); - }); - } + } } + }, ), ), 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 176c0ab97cc26fe4141b2deb0c5dda0594465971 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 9 Jun 2021 14:18:16 +0300 Subject: [PATCH 052/124] first step from live care fixes --- .../live_care/AlternativeServicesList.dart | 1 + .../patient/LiveCarePatientServices.dart | 10 +- .../viewModel/LiveCarePatientViewModel.dart | 10 +- lib/models/livecare/start_call_req.dart | 72 +++--- lib/screens/home/home_patient_card.dart | 9 +- lib/screens/home/home_screen.dart | 2 +- lib/screens/live_care/end_call_screen.dart | 9 +- .../live-care_transfer_to_admin.dart | 2 +- .../live_care/live_care_patient_screen.dart | 2 +- .../patient_profile_screen.dart | 231 ++++++++++-------- 10 files changed, 182 insertions(+), 166 deletions(-) diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index fab11b71..11f27b95 100644 --- a/lib/core/model/live_care/AlternativeServicesList.dart +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -11,6 +11,7 @@ class AlternativeService { AlternativeService.fromJson(Map json) { serviceID = json['ServicID']; serviceName = json['ServiceName']; + isSelected = false; } Map toJson() { diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index e813e017..de381962 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -18,7 +18,7 @@ class LiveCarePatientServices extends BaseService { bool _isFinished = false; - bool _isLive = true; + bool _isLive = false; bool get isFinished => _isFinished; @@ -74,7 +74,7 @@ class LiveCarePatientServices extends BaseService { }, body: startCallReq.toJson(), isLiveCare: _isLive); } - Future endCallWithCharge(int vcID, String altServiceList) async { + Future endCallWithCharge(int vcID, List altServiceList) async { hasError = false; await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) { endCallResponse = response; @@ -84,6 +84,7 @@ class LiveCarePatientServices extends BaseService { }, body: { "VC_ID": vcID, "AltServiceList": altServiceList, + "generalid":GENERAL_ID }, isLiveCare: _isLive); } @@ -110,7 +111,7 @@ class LiveCarePatientServices extends BaseService { hasError = true; super.error = error; }, body: { - "VC_ID": vcID, + "VC_ID": vcID, "generalid": GENERAL_ID }, isLiveCare: _isLive); } @@ -140,6 +141,7 @@ class LiveCarePatientServices extends BaseService { super.error = error; }, body: { "VC_ID": vcID, - }, isLiveCare: _isLive); + "generalid": GENERAL_ID + }, isLiveCare: _isLive); } } diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 8dc83c06..378013bd 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -101,13 +101,13 @@ class LiveCarePatientViewModel extends BaseViewModel { Future endCallWithCharge(int vcID, bool isConfirmed) async { setState(ViewState.BusyLocal); - String selectedServicesString = ""; + List selectedServices = []; if (isConfirmed) { - selectedServicesString = getSelectedAlternativeServices(); + selectedServices = getSelectedAlternativeServices(); } await _liveCarePatientServices.endCallWithCharge( - vcID, selectedServicesString); + vcID, selectedServices); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); @@ -117,14 +117,14 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - String getSelectedAlternativeServices() { + List getSelectedAlternativeServices() { List selectedServices = List(); for (AlternativeService service in alternativeServicesList) { if (service.isSelected) { selectedServices.add(service.serviceID); } } - return selectedServices.toString(); + return selectedServices; } Future getAlternativeServices(int vcID) async { diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index 1ad04480..b3ceabb5 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,56 +1,56 @@ class StartCallReq { - int vCID; - bool isrecall; - String tokenID; - String generalid; + String clincName; + int clinicId; + String docSpec; + String docotrName; int doctorId; + String generalid; bool isOutKsa; + bool isrecall; String projectName; - String docotrName; - String clincName; - String docSpec; - int clinicId; + String tokenID; + int vCID; StartCallReq( - {this.vCID, - this.isrecall, - this.tokenID, - this.generalid, - this.doctorId, - this.isOutKsa, - this.projectName, - this.docotrName, - this.clincName, - this.docSpec, - this.clinicId}); + {this.clincName, + this.clinicId, + this.docSpec, + this.docotrName, + this.doctorId, + this.generalid, + this.isOutKsa, + this.isrecall, + this.projectName, + this.tokenID, + this.vCID}); StartCallReq.fromJson(Map json) { - vCID = json['VC_ID']; - isrecall = json['isrecall']; - tokenID = json['TokenID']; - generalid = json['generalid']; + clincName = json['clincName']; + clinicId = json['ClinicId']; + docSpec = json['Doc_Spec']; + docotrName = json['DocotrName']; doctorId = json['DoctorId']; + generalid = json['generalid']; isOutKsa = json['IsOutKsa']; + isrecall = json['isrecall']; projectName = json['projectName']; - docotrName = json['DocotrName']; - clincName = json['clincName']; - docSpec = json['Doc_Spec']; - clinicId = json['ClinicId']; + tokenID = json['TokenID']; + vCID = json['VC_ID']; } Map toJson() { final Map data = new Map(); - data['VC_ID'] = this.vCID; - data['isrecall'] = this.isrecall; - data['TokenID'] = this.tokenID; - data['generalid'] = this.generalid; + data['clincName'] = this.clincName; + data['ClinicId'] = this.clinicId; + data['Doc_Spec'] = this.docSpec; + data['DocotrName'] = this.docotrName; data['DoctorId'] = this.doctorId; + data['generalid'] = this.generalid; data['IsOutKsa'] = this.isOutKsa; + data['isrecall'] = this.isrecall; data['projectName'] = this.projectName; - data['DocotrName'] = this.docotrName; - data['clincName'] = this.clincName; - data['Doc_Spec'] = this.docSpec; - data['ClinicId'] = this.clinicId; + data['TokenID'] = this.tokenID; + data['VC_ID'] = this.vCID; return data; } -} +} \ No newline at end of file diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 6f6712ec..b388a7e2 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -36,11 +36,10 @@ class HomePatientCard extends StatelessWidget { Expanded( child: Stack( children: [ - Positioned( - bottom: 0.1, - right: 0.5, - width: 23.0, - height: 25.0, + Container( + margin: EdgeInsets.only(top: 18, left: 10), + color:Colors.transparent, + child: Icon( cardIcon, size: iconSize * 2, diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index ab0fe73f..82add64c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -329,7 +329,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], - iconSize: 24, + iconSize: 21, text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", onTap: () { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 1b652e36..617eef34 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -142,25 +142,22 @@ class _EndCallScreenState extends State { 'patient/health_summary.png', onTap: () { Helpers.showConfirmationDialog(context, - "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC}${TranslationBase.of(context).instruction} ?", + "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - liveCareModel.sendSMSInstruction(widget.patient.vcId); + await liveCareModel.sendSMSInstruction(widget.patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { DrAppToastMsg.showSuccesToast("You successfully sent SMS instructions"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); } }); }, isInPatient: isInpatient, isDartIcon: true, - isDisable: true, + // isDisable: true, dartIcon: DoctorApp.send_instruction), PatientProfileCardModel( TranslationBase.of(context).transferTo, diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index 2d0fb7d7..233f59d8 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -120,7 +120,7 @@ class _LivaCareTransferToAdminState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - model.transferToAdmin(widget.patient.vcId, noteController.text); + await model.transferToAdmin(widget.patient.vcId, noteController.text); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 0b741989..e6cdad17 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -31,7 +31,7 @@ class _LiveCarePatientScreenState extends State { super.initState(); timer = Timer.periodic(Duration(seconds: 10), (Timer t) { if (_liveCareViewModel != null) { - _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); + // _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); } }); } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 55b2d6f9..e64b582f 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,18 +1,13 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; -import 'package:doctor_app_flutter/util/VideoChannel.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/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -156,51 +151,57 @@ class _PatientProfileScreenState extends State SizedBox( height: MediaQuery.of(context).size.height * 0.05, ) - ], - ), - ), - ], ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, + ), + ], + ), + if (isFromLiveCare + ? patient.episodeNo != null + : patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: isFromLiveCare + ? Colors.red.shade700 + : patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, height: 30, ), onPressed: () async { - if (patient.patientStatusType == - 43) { + if ((isFromLiveCare && + patient.appointmentNo != null && + patient.appointmentNo != 0) || + patient.patientStatusType == + 43) { PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); GifLoaderDialogUtils.showMyDialog( context); await model.postEpisode( @@ -220,11 +221,18 @@ class _PatientProfileScreenState extends State if (patient.episodeNo != 0) AppButton( title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + "${TranslationBase + .of(context) + .update}\n${TranslationBase + .of(context) + .episode}", color: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, + isFromLiveCare + ? Colors.red.shade700 + : patient.patientStatusType == + 43 + ? Colors.red.shade700 + : Colors.grey.shade700, fontColor: Colors.white, vPadding: 8, radius: 30, @@ -237,8 +245,12 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () { - if (patient.patientStatusType == - 43) { + if ((isFromLiveCare && + patient.appointmentNo != + null && + patient.appointmentNo != 0) || + patient.patientStatusType == + 43) { Navigator.of(context).pushNamed( UPDATE_EPISODE, arguments: { @@ -283,65 +295,70 @@ class _PatientProfileScreenState extends State TranslationBase.of(context).initiateCall, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - if(isCallFinished) { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - EndCallScreen(patient:patient))); - } else { - GifLoaderDialogUtils.showMyDialog(context); - await model.startCall( isReCall : false, vCID: patient.vcId); - - if(model.state == ViewState.ErrorLocal) { - GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(model.error); - } else { - await model.getDoctorProfile(); - patient.appointmentNo = model.startCallRes.appointmentNo; - patient.episodeNo = 0; + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + EndCallScreen(patient:patient))); - GifLoaderDialogUtils.hideDialog(context); - await VideoChannel.openVideoCallScreen( - kToken: model.startCallRes.openTokenID, - kSessionId: model.startCallRes.openSessionID, - kApiKey: '46209962', - vcId: patient.vcId, - tokenID: await model.getToken(), - generalId: GENERAL_ID, - doctorId: model.doctorProfile.doctorID, - onFailure: (String error) { - DrAppToastMsg.showErrorToast(error); - }, - onCallEnd: () { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(context); - model.endCall(patient.vcId, false,).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - setState(() { - isCallFinished = true; - }); - }); - }); - }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(context); - model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - setState(() { - isCallFinished = true; - }); - }); - }); - }); - } - } + // if(isCallFinished) { + // Navigator.push(context, MaterialPageRoute( + // builder: (BuildContext context) => + // EndCallScreen(patient:patient))); + // } else { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.startCall( isReCall : false, vCID: patient.vcId); + // + // if(model.state == ViewState.ErrorLocal) { + // GifLoaderDialogUtils.hideDialog(context); + // Helpers.showErrorToast(model.error); + // } else { + // await model.getDoctorProfile(); + // patient.appointmentNo = model.startCallRes.appointmentNo; + // patient.episodeNo = 0; + // + // GifLoaderDialogUtils.hideDialog(context); + // await VideoChannel.openVideoCallScreen( + // kToken: model.startCallRes.openTokenID, + // kSessionId: model.startCallRes.openSessionID, + // kApiKey: '46209962', + // vcId: patient.vcId, + // tokenID: await model.getToken(), + // generalId: GENERAL_ID, + // doctorId: model.doctorProfile.doctorID, + // onFailure: (String error) { + // DrAppToastMsg.showErrorToast(error); + // }, + // onCallEnd: () { + // WidgetsBinding.instance.addPostFrameCallback((_) { + // GifLoaderDialogUtils.showMyDialog(context); + // model.endCall(patient.vcId, false,).then((value) { + // GifLoaderDialogUtils.hideDialog(context); + // if (model.state == ViewState.ErrorLocal) { + // DrAppToastMsg.showErrorToast(model.error); + // } + // setState(() { + // isCallFinished = true; + // }); + // }); + // }); + // }, + // onCallNotRespond: (SessionStatusModel sessionStatusModel) { + // WidgetsBinding.instance.addPostFrameCallback((_) { + // GifLoaderDialogUtils.showMyDialog(context); + // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { + // GifLoaderDialogUtils.hideDialog(context); + // if (model.state == ViewState.ErrorLocal) { + // DrAppToastMsg.showErrorToast(model.error); + // } + // setState(() { + // isCallFinished = true; + // }); + // }); + // + // }); + // }); + // } + // } }, ), From e76ecf172fe331c10acb068779fcefa65f5ae492 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 9 Jun 2021 14:46:03 +0300 Subject: [PATCH 053/124] video-straming-android-changes --- android/app/build.gradle | 1 + .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 32 +- .../hmgDr/ui/fragment/VideoCallFragment.kt | 385 ++++++++++++++++++ android/app/src/main/res/values/strings.xml | 2 + pubspec.lock | 2 +- 5 files changed, 410 insertions(+), 12 deletions(-) create mode 100644 android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt diff --git a/android/app/build.gradle b/android/app/build.gradle index 16960d54..deb42f99 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -70,6 +70,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index 612118c9..b95e7cb9 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -2,17 +2,19 @@ package com.hmg.hmgDr import android.app.Activity import android.content.Intent +import android.os.Bundle import androidx.annotation.NonNull +import com.google.gson.GsonBuilder import com.hmg.hmgDr.Model.GetSessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel -import com.hmg.hmgDr.ui.VideoCallActivity -import com.google.gson.GsonBuilder +import io.flutter.embedding.android.FlutterFragment import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugins.GeneratedPluginRegistrant + class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler { private val CHANNEL = "Dr.cloudSolution/videoCall" @@ -20,6 +22,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler private var call: MethodCall? = null private val LAUNCH_VIDEO: Int = 1 + private val flutterFragment: FlutterFragment? = null override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine) @@ -27,6 +30,11 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler(this) } + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + } + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { @@ -59,15 +67,17 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler private fun openVideoCall(apiKey: String?, sessionId: String?, token: String?, appLang: String?, baseUrl: String?, sessionStatusModel: GetSessionStatusModel) { // val videoCallActivity = VideoCallActivity() - val intent = Intent(this, VideoCallActivity::class.java) - intent.putExtra("apiKey", apiKey) - intent.putExtra("sessionId", sessionId) - intent.putExtra("token", token) - intent.putExtra("appLang", appLang) - intent.putExtra("baseUrl", baseUrl) - intent.putExtra("sessionStatusModel", sessionStatusModel) - startActivityForResult(intent, LAUNCH_VIDEO) - +// val intent = Intent(this, VideoCallActivity::class.java) +// intent.putExtra("apiKey", apiKey) +// intent.putExtra("sessionId", sessionId) +// intent.putExtra("token", token) +// intent.putExtra("appLang", appLang) +// intent.putExtra("baseUrl", baseUrl) +// intent.putExtra("sessionStatusModel", sessionStatusModel) +// startActivityForResult(intent, LAUNCH_VIDEO) + + val transaction = supportFragmentManager.beginTransaction() +// transaction.add() } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt new file mode 100644 index 00000000..be343b89 --- /dev/null +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -0,0 +1,385 @@ +package com.hmg.hmgDr.ui.fragment + +import android.Manifest +import android.annotation.SuppressLint +import android.app.Activity +import android.content.Intent +import android.opengl.GLSurfaceView +import android.os.Bundle +import android.os.CountDownTimer +import android.os.Handler +import android.os.Looper +import android.util.Log +import android.view.LayoutInflater +import android.view.MotionEvent +import android.view.View +import android.view.ViewGroup +import android.widget.* +import androidx.fragment.app.Fragment +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel +import com.hmg.hmgDr.Model.GetSessionStatusModel +import com.hmg.hmgDr.Model.SessionStatusModel +import com.hmg.hmgDr.R +import com.hmg.hmgDr.ui.VideoCallActivity +import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter +import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView +import com.hmg.hmgDr.ui.VideoCallPresenterImpl +import com.opentok.android.* +import com.opentok.android.PublisherKit.PublisherListener +import pub.devrel.easypermissions.AfterPermissionGranted +import pub.devrel.easypermissions.AppSettingsDialog +import pub.devrel.easypermissions.EasyPermissions +import pub.devrel.easypermissions.EasyPermissions.PermissionCallbacks +import java.util.* + +class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListener, PublisherListener, + SubscriberKit.VideoListener, VideoCallView { + + lateinit var videoCallPresenter: VideoCallPresenter + + private var mSession: Session? = null + private var mPublisher: Publisher? = null + private var mSubscriber: Subscriber? = null + + private var mVolHandler: Handler? = null + private var mConnectedHandler: Handler? = null + private var mVolRunnable: Runnable? = null + private var mConnectedRunnable: Runnable? = null + + private var mPublisherViewContainer: FrameLayout? = null + private var mSubscriberViewContainer: RelativeLayout? = null + private var controlPanel: RelativeLayout? = null + + private var apiKey: String? = null + private var sessionId: String? = null + private var token: String? = null + private var appLang: String? = null + private var baseUrl: String? = null + + private var isSwitchCameraClicked = false + private var isCameraClicked = false + private var isSpeckerClicked = false + private var isMicClicked = false + + private var mCallBtn: ImageView? = null + private var mCameraBtn: ImageView? = null + private var mSwitchCameraBtn: ImageView? = null + private var mspeckerBtn: ImageView? = null + private var mMicBtn: ImageView? = null + + private val progressBar: ProgressBar? = null + private val countDownTimer: CountDownTimer? = null + private val progressBarTextView: TextView? = null + private val progressBarLayout: RelativeLayout? = null + + private var isConnected = false + + private var sessionStatusModel: GetSessionStatusModel? = null + + + override fun onCreate(savedInstanceState: Bundle?) { + requireActivity().setTheme(R.style.AppTheme) + super.onCreate(savedInstanceState) + + requestPermissions() + } + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle?): View? { + + val view = inflater.inflate(R.layout.activity_video_call, container, false) + + Objects.requireNonNull(requireActivity().actionBar)!!.hide() + initUI(view) + + return view + } + + override fun onPause() { + super.onPause() + if (mSession == null) { + return + } + mSession!!.onPause() + if (requireActivity().isFinishing) { + disconnectSession() + } + } + + override fun onResume() { + super.onResume() + if (mSession == null) { + return + } + mSession!!.onResume() + } + + override fun onDestroy() { + disconnectSession() + super.onDestroy() + } + + @SuppressLint("ClickableViewAccessibility") + private fun initUI(view: View) { + mPublisherViewContainer = view.findViewById(R.id.local_video_view_container) + mSubscriberViewContainer = view.findViewById(R.id.remote_video_view_container) + + arguments?.run { + apiKey = getString("apiKey") + sessionId = getString("sessionId") + token = getString("token") + appLang = getString("appLang") + baseUrl = getString("baseUrl") + sessionStatusModel = getParcelable("sessionStatusModel") + } + + controlPanel = view.findViewById(R.id.control_panel) + videoCallPresenter = VideoCallPresenterImpl(this, baseUrl) + mCallBtn = view.findViewById(R.id.btn_call) + mCameraBtn = view.findViewById(R.id.btn_camera) + mSwitchCameraBtn = view.findViewById(R.id.btn_switch_camera) + mspeckerBtn = view.findViewById(R.id.btn_specker) + mMicBtn = view.findViewById(R.id.btn_mic) + + // progressBarLayout=findViewById(R.id.progressBar); + // progressBar=findViewById(R.id.progress_bar); +// progressBarTextView=findViewById(R.id.progress_bar_text); +// progressBar.setVisibility(View.GONE); + hiddenButtons() + checkClientConnected() + mSubscriberViewContainer!!.setOnTouchListener { v: View?, event: MotionEvent? -> + controlPanel!!.visibility = View.VISIBLE + mVolHandler!!.removeCallbacks(mVolRunnable!!) + mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) + true + } + if (appLang == "ar") { + progressBarLayout!!.layoutDirection = View.LAYOUT_DIRECTION_RTL + } + } + + private fun checkClientConnected() { + mConnectedHandler = Handler((Looper.getMainLooper())) + mConnectedRunnable = Runnable { + if (!isConnected) { + videoCallPresenter.callClintConnected(sessionStatusModel) + } + } + mConnectedHandler!!.postDelayed(mConnectedRunnable!!, (55 * 1000).toLong()) + } + + private fun hiddenButtons() { + mVolHandler = Handler() + mVolRunnable = Runnable { controlPanel!!.visibility = View.GONE } + mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) + } + + override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this) + } + + override fun onPermissionsGranted(requestCode: Int, perms: List) { + Log.d(TAG, "onPermissionsGranted:" + requestCode + ":" + perms.size) + } + + override fun onPermissionsDenied(requestCode: Int, perms: List) { + Log.d(TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size) + if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) { + AppSettingsDialog.Builder(this) + .setTitle(getString(R.string.title_settings_dialog)) + .setRationale(getString(R.string.rationale_ask_again)) + .setPositiveButton(getString(R.string.setting)) + .setNegativeButton(getString(R.string.cancel)) + .setRequestCode(RC_SETTINGS_SCREEN_PERM) + .build() + .show() + } + } + + @AfterPermissionGranted(RC_VIDEO_APP_PERM) + private fun requestPermissions() { + val perms = arrayOf(Manifest.permission.INTERNET, Manifest.permission.CAMERA) + if (EasyPermissions.hasPermissions(requireContext(), *perms)) { + try { + mSession = Session.Builder(context, apiKey, sessionId).build() + mSession!!.setSessionListener(this) + mSession!!.connect(token) + } catch (e: Exception) { + e.printStackTrace() + } + } else { + EasyPermissions.requestPermissions(this, getString(R.string.remaining_ar), RC_VIDEO_APP_PERM, *perms) + } + } + + override fun onConnected(session: Session?) { + Log.i(TAG, "Session Connected") + mPublisher = Publisher.Builder(requireContext()).build() + mPublisher!!.setPublisherListener(this) + mPublisherViewContainer!!.addView(mPublisher!!.view) + if (mPublisher!!.getView() is GLSurfaceView) { + (mPublisher!!.getView() as GLSurfaceView).setZOrderOnTop(true) + } + mSession!!.publish(mPublisher) + } + + override fun onDisconnected(session: Session) { + Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId) + mSession = null + } + + override fun onError(session: Session, opentokError: OpentokError) { + Log.d(TAG, "onError: Error (" + opentokError.message + ") in session " + session.sessionId) + Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() + requireActivity().finish() + } + + override fun onStreamReceived(session: Session, stream: Stream) { + Log.d(TAG, "onStreamReceived: New stream " + stream.streamId + " in session " + session.sessionId) + if (mSubscriber != null) { + isConnected = true + return + } + isConnected = true + subscribeToStream(stream) + videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) + } + + override fun onStreamDropped(session: Session, stream: Stream) { + Log.d(TAG, "onStreamDropped: Stream " + stream.streamId + " dropped from session " + session.sessionId) + if (mSubscriber == null) { + return + } + if (mSubscriber!!.stream == stream) { + mSubscriberViewContainer!!.removeView(mSubscriber!!.view) + mSubscriber!!.destroy() + mSubscriber = null + } + disconnectSession() + } + + override fun onStreamCreated(publisherKit: PublisherKit?, stream: Stream) { + Log.d(TAG, "onStreamCreated: Own stream " + stream.streamId + " created") + } + + override fun onStreamDestroyed(publisherKit: PublisherKit?, stream: Stream) { + Log.d(TAG, "onStreamDestroyed: Own stream " + stream.streamId + " destroyed") + } + + override fun onError(publisherKit: PublisherKit?, opentokError: OpentokError) { + Log.d(VideoCallFragment.TAG, "onError: Error (" + opentokError.message + ") in publisher") + Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() + requireActivity().finish() + } + + override fun onVideoDataReceived(subscriberKit: SubscriberKit?) { + mSubscriber!!.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL) + mSubscriberViewContainer!!.addView(mSubscriber!!.view) + } + + override fun onVideoDisabled(subscriberKit: SubscriberKit?, s: String?) {} + + override fun onVideoEnabled(subscriberKit: SubscriberKit?, s: String?) {} + + override fun onVideoDisableWarning(subscriberKit: SubscriberKit?) {} + + override fun onVideoDisableWarningLifted(subscriberKit: SubscriberKit?) {} + + private fun subscribeToStream(stream: Stream) { + mSubscriber = Subscriber.Builder(requireContext(), stream).build() + mSubscriber!!.setVideoListener(this) + mSession!!.subscribe(mSubscriber) + } + + private fun disconnectSession() { + if (mSession == null) { + requireActivity().setResult(Activity.RESULT_CANCELED) + requireActivity().finish() + return + } + if (mSubscriber != null) { + mSubscriberViewContainer!!.removeView(mSubscriber!!.view) + mSession!!.unsubscribe(mSubscriber) + mSubscriber!!.destroy() + mSubscriber = null + } + if (mPublisher != null) { + mPublisherViewContainer!!.removeView(mPublisher!!.view) + mSession!!.unpublish(mPublisher) + mPublisher!!.destroy() + mPublisher = null + } + mSession!!.disconnect() + countDownTimer?.cancel() + videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) + requireActivity().finish() + } + + fun onSwitchCameraClicked(view: View?) { + if (mPublisher != null) { + isSwitchCameraClicked = !isSwitchCameraClicked + mPublisher!!.cycleCamera() + val res = if (isSwitchCameraClicked) R.drawable.flip_disapled else R.drawable.flip_enabled + mSwitchCameraBtn!!.setImageResource(res) + } + } + + fun onCameraClicked(view: View?) { + if (mPublisher != null) { + isCameraClicked = !isCameraClicked + mPublisher!!.publishVideo = !isCameraClicked + val res = if (isCameraClicked) R.drawable.video_disanabled else R.drawable.video_enabled + mCameraBtn!!.setImageResource(res) + } + } + + fun onSpeckerClicked(view: View?) { + if (mSubscriber != null) { + isSpeckerClicked = !isSpeckerClicked + mSubscriber!!.subscribeToAudio = !isSpeckerClicked + val res = if (isSpeckerClicked) R.drawable.audio_disabled else R.drawable.audio_enabled + mspeckerBtn!!.setImageResource(res) + } + } + + fun onMicClicked(view: View?) { + if (mPublisher != null) { + isMicClicked = !isMicClicked + mPublisher!!.publishAudio = !isMicClicked + val res = if (isMicClicked) R.drawable.mic_disabled else R.drawable.mic_enabled + mMicBtn!!.setImageResource(res) + } + } + + fun onCallClicked(view: View?) { + disconnectSession() + } + + override fun onCallSuccessful(sessionStatusModel: SessionStatusModel) { + if (sessionStatusModel.sessionStatus == 2 || sessionStatusModel.sessionStatus == 3) { + val returnIntent = Intent() + returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel) + requireActivity().setResult(Activity.RESULT_OK, returnIntent) + requireActivity().finish() + } + } + + override fun onCallChangeCallStatusSuccessful(sessionStatusModel: SessionStatusModel?) {} + + override fun onFailure() {} + + companion object { + @JvmStatic + fun newInstance(args: Bundle) = + VideoCallFragment().apply { + arguments = args + } + + private val TAG = VideoCallActivity::class.java.simpleName + + private const val RC_SETTINGS_SCREEN_PERM = 123 + private const val RC_VIDEO_APP_PERM = 124 + + } +} \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 74349756..bc694f7c 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -4,5 +4,7 @@ الوقت المتبقي بالثانيه: Settings Cancel + + Hello blank fragment \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 77df9848..49ff6372 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -587,7 +587,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: From 0b52b4009dadc429fda86c2adcc64db68176adaa Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Jun 2021 14:46:45 +0300 Subject: [PATCH 054/124] fix label on replay referral --- android/app/src/main/AndroidManifest.xml | 13 +++++++++--- .../com/hmg/hmgDr/ui/VideoCallActivity.java | 20 ++++++++++--------- .../referral/AddReplayOnReferralPatient.dart | 10 +++++----- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c656ebbf..0e71249f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -9,12 +9,19 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - - - + + + + + + + + + + controlPanel.setVisibility(View.GONE); mVolHandler.postDelayed(mVolRunnable, 5 * 1000); } @@ -269,8 +265,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi public void onError(Session session, OpentokError opentokError) { Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in session " + session.getSessionId()); - Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show(); - finish(); + // Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show(); + //finish(); } @Override @@ -282,6 +278,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi } isConnected = true; subscribeToStream(stream); + if(mConnectedHandler!=null && mConnectedRunnable!=null) + mConnectedHandler.removeCallbacks(mConnectedRunnable); videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(3,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID())); } @@ -315,8 +313,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi public void onError(PublisherKit publisherKit, OpentokError opentokError) { Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in publisher"); - Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show(); - finish(); + // Toast.makeText(this, "onError: Error (" + opentokError.getMessage() + ") in publisher", Toast.LENGTH_LONG).show(); + // finish(); } @Override @@ -427,6 +425,10 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel); setResult(Activity.RESULT_OK, returnIntent); finish(); + } else if( sessionStatusModel.getSessionStatus() == 4 ){ + isConnected = true; + if(mConnectedHandler!=null && mConnectedRunnable!=null) + mConnectedHandler.removeCallbacks(mConnectedRunnable); } } diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index f54a18ac..8055517d 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -58,7 +58,7 @@ class _AddReplayOnReferralPatientState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - BottomSheetTitle(title: 'Replay'), + BottomSheetTitle(title: 'Reply'), SizedBox( height: 10.0, ), @@ -70,7 +70,7 @@ class _AddReplayOnReferralPatientState Stack( children: [ AppTextFieldCustom( - hintText: 'Replay your responses here', + hintText: 'Reply your responses here', controller: replayOnReferralController, maxLines: 35, minLines: 25, @@ -128,7 +128,7 @@ class _AddReplayOnReferralPatientState Container( margin: EdgeInsets.all(5), child: AppButton( - title: 'Submit Replay', + title: 'Submit Reply', color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { @@ -147,12 +147,12 @@ class _AddReplayOnReferralPatientState } else { GifLoaderDialogUtils.hideDialog(context); DrAppToastMsg.showSuccesToast( - "Your Replay Added Successfully"); + "Your Reply Added Successfully"); Navigator.of(context).pop(); Navigator.of(context).pop(); } } else { - Helpers.showErrorToast("You can't add empty replay"); + Helpers.showErrorToast("You can't add empty reply"); setState(() { isSubmitted = false; }); From 36caca0e4659d7d518f59f7e90e7940519fe681a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 9 Jun 2021 16:07:58 +0300 Subject: [PATCH 055/124] test live care and general result header in lab result --- lib/config/config.dart | 4 +- .../patient/LiveCarePatientServices.dart | 2 +- .../live_care/live_care_patient_screen.dart | 2 +- .../lab_result/laboratory_result_page.dart | 46 ++- .../patient_profile_screen.dart | 129 +++---- .../profile/GeneralLabResultHeader.dart | 347 ++++++++++++++++++ 6 files changed, 445 insertions(+), 85 deletions(-) create mode 100644 lib/widgets/patients/profile/GeneralLabResultHeader.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e2f9eb6a..97e1d4dd 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/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index de381962..29b120ec 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -18,7 +18,7 @@ class LiveCarePatientServices extends BaseService { bool _isFinished = false; - bool _isLive = false; + bool _isLive = true; bool get isFinished => _isFinished; diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index e6cdad17..0b741989 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -31,7 +31,7 @@ class _LiveCarePatientScreenState extends State { super.initState(); timer = Timer.periodic(Duration(seconds: 10), (Timer t) { if (_liveCareViewModel != null) { - // _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); + _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); } }); } 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 5f79038f..91e5145f 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/GeneralLabResultHeader.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -32,37 +32,45 @@ class _LaboratoryResultPageState extends State { @override Widget build(BuildContext context) { return BaseView( - // onModelReady: (model) => model.getLaboratoryResult( - // invoiceNo: widget.patientLabOrders.invoiceNo, - // clinicID: widget.patientLabOrders.clinicID, - // projectID: widget.patientLabOrders.projectID, - // orderNo: widget.patientLabOrders.orderNo, - // patient: widget.patient, - // isInpatient: widget.patientType == "1"), onModelReady: (model) => model.getPatientLabResult( patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBar: PatientProfileHeaderWhitAppointmentAppBar( - patient: widget.patient, - patientType: widget.patientType ?? "0", - arrivalType: widget.arrivalType ?? "0", - orderNo: widget.patientLabOrders.orderNo, - appointmentDate: widget.patientLabOrders.orderDate, - doctorName: widget.patientLabOrders.doctorName, - branch: widget.patientLabOrders.projectName, - clinic: widget.patientLabOrders.clinicDescription, - profileUrl: widget.patientLabOrders.doctorImageURL, - invoiceNO: widget.patientLabOrders.invoiceNo, + appBar: GeneralLabResultHeader( + patient: widget.patient, + patientType: widget.patientType ?? "0", + arrivalType: widget.arrivalType ?? "0", + orderNo: widget.patientLabOrders.orderNo, + appointmentDate: widget.patientLabOrders.orderDate, + doctorName: widget.patientLabOrders.doctorName, + branch: widget.patientLabOrders.projectName, + clinic: widget.patientLabOrders.clinicDescription, + profileUrl: widget.patientLabOrders.doctorImageURL, + invoiceNO: widget.patientLabOrders.invoiceNo, ), + + + // PatientProfileHeaderWhitAppointmentAppBar( + // patient: widget.patient, + // patientType: widget.patientType ?? "0", + // arrivalType: widget.arrivalType ?? "0", + // orderNo: widget.patientLabOrders.orderNo, + // appointmentDate: widget.patientLabOrders.orderDate, + // doctorName: widget.patientLabOrders.doctorName, + // branch: widget.patientLabOrders.projectName, + // clinic: widget.patientLabOrders.clinicDescription, + // profileUrl: widget.patientLabOrders.doctorImageURL, + // invoiceNO: widget.patientLabOrders.invoiceNo, + // ), baseViewModel: model, body: AppScaffold( isShowAppBar: false, body: SingleChildScrollView( child: Column( children: [ + LaboratoryResultWidget( onTap: () async {}, billNo: widget.patientLabOrders.invoiceNo, diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index e64b582f..d9aa7d8d 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,13 +1,18 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; +import 'package:doctor_app_flutter/util/VideoChannel.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/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -295,70 +300,70 @@ class _PatientProfileScreenState extends State TranslationBase.of(context).initiateCall, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - EndCallScreen(patient:patient))); + // Navigator.push(context, MaterialPageRoute( + // builder: (BuildContext context) => + // EndCallScreen(patient:patient))); - // if(isCallFinished) { - // Navigator.push(context, MaterialPageRoute( - // builder: (BuildContext context) => - // EndCallScreen(patient:patient))); - // } else { - // GifLoaderDialogUtils.showMyDialog(context); - // await model.startCall( isReCall : false, vCID: patient.vcId); - // - // if(model.state == ViewState.ErrorLocal) { - // GifLoaderDialogUtils.hideDialog(context); - // Helpers.showErrorToast(model.error); - // } else { - // await model.getDoctorProfile(); - // patient.appointmentNo = model.startCallRes.appointmentNo; - // patient.episodeNo = 0; - // - // GifLoaderDialogUtils.hideDialog(context); - // await VideoChannel.openVideoCallScreen( - // kToken: model.startCallRes.openTokenID, - // kSessionId: model.startCallRes.openSessionID, - // kApiKey: '46209962', - // vcId: patient.vcId, - // tokenID: await model.getToken(), - // generalId: GENERAL_ID, - // doctorId: model.doctorProfile.doctorID, - // onFailure: (String error) { - // DrAppToastMsg.showErrorToast(error); - // }, - // onCallEnd: () { - // WidgetsBinding.instance.addPostFrameCallback((_) { - // GifLoaderDialogUtils.showMyDialog(context); - // model.endCall(patient.vcId, false,).then((value) { - // GifLoaderDialogUtils.hideDialog(context); - // if (model.state == ViewState.ErrorLocal) { - // DrAppToastMsg.showErrorToast(model.error); - // } - // setState(() { - // isCallFinished = true; - // }); - // }); - // }); - // }, - // onCallNotRespond: (SessionStatusModel sessionStatusModel) { - // WidgetsBinding.instance.addPostFrameCallback((_) { - // GifLoaderDialogUtils.showMyDialog(context); - // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - // GifLoaderDialogUtils.hideDialog(context); - // if (model.state == ViewState.ErrorLocal) { - // DrAppToastMsg.showErrorToast(model.error); - // } - // setState(() { - // isCallFinished = true; - // }); - // }); - // - // }); - // }); - // } - // } + if(isCallFinished) { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + EndCallScreen(patient:patient))); + } else { + GifLoaderDialogUtils.showMyDialog(context); + await model.startCall( isReCall : false, vCID: patient.vcId); + + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(model.error); + } else { + await model.getDoctorProfile(); + patient.appointmentNo = model.startCallRes.appointmentNo; + patient.episodeNo = 0; + + GifLoaderDialogUtils.hideDialog(context); + await VideoChannel.openVideoCallScreen( + kToken: model.startCallRes.openTokenID, + kSessionId: model.startCallRes.openSessionID, + kApiKey: '46209962', + vcId: patient.vcId, + tokenID: await model.getToken(), + generalId: GENERAL_ID, + doctorId: model.doctorProfile.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + }, + onCallEnd: () { + WidgetsBinding.instance.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(context); + model.endCall(patient.vcId, false,).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + setState(() { + isCallFinished = true; + }); + }); + }); + }, + onCallNotRespond: (SessionStatusModel sessionStatusModel) { + WidgetsBinding.instance.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(context); + model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + setState(() { + isCallFinished = true; + }); + }); + + }); + }); + } + } }, ), diff --git a/lib/widgets/patients/profile/GeneralLabResultHeader.dart b/lib/widgets/patients/profile/GeneralLabResultHeader.dart new file mode 100644 index 00000000..5f22459a --- /dev/null +++ b/lib/widgets/patients/profile/GeneralLabResultHeader.dart @@ -0,0 +1,347 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.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'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class GeneralLabResultHeader extends StatelessWidget + with PreferredSizeWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final bool isPrescriptions; + final bool isMedicalFile; + final String episode; + final String vistDate; + + final String clinic; + GeneralLabResultHeader( + {this.patient, + this.patientType, + this.arrivalType, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.isMedicalFile = false, + this.episode, + this.vistDate}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + int gender = 1; + if (patient.patientDetails != null) { + gender = patient.patientDetails.gender; + } else { + gender = patient.gender; + } + + return Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: MediaQuery.of(context).size.height * 0.23, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + patient.firstName != null + ? (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.fullName??patient?.patientDetails?.fullName??""), + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + patient?.mobileNumber??""); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ) + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patient.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + arrivalType == '1' || patient.arrivedOn == null + ? AppText( + patient.startTime != null + ? patient.startTime + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : AppText( + AppDateUtils.convertStringToDateFormat( + patient.arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: HexColor("#20A169"), + ), + child: AppText( + patient.startTime ?? "", + color: Colors.white, + fontSize: 1.5 * SizeConfig.textMultiplier, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2( + patient.appointmentDate.toString() ?? ''), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 12, fontFamily: 'Poppins')), + new TextSpan( + text: patient?.patientId?.toString() ?? "", + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality ?? + "", + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + patient?.nationalityFlagURL??"", + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 14)), + ], + ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: "Result Date: ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String newDate = ""; + const start = "/Date("; + const end = "+0300)"; + + if (str.isNotEmpty) { + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + } + + return newDate.toString(); + } + + + + @override + Size get preferredSize => Size(double.maxFinite, 310); +} From cb5abfb2ec4a68f079bfefdaebb1395f040d80c7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 9 Jun 2021 16:10:24 +0300 Subject: [PATCH 056/124] remove comment code --- .../profile/lab_result/laboratory_result_page.dart | 13 ------------- 1 file changed, 13 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 91e5145f..c7a98924 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -51,19 +51,6 @@ class _LaboratoryResultPageState extends State { invoiceNO: widget.patientLabOrders.invoiceNo, ), - - // PatientProfileHeaderWhitAppointmentAppBar( - // patient: widget.patient, - // patientType: widget.patientType ?? "0", - // arrivalType: widget.arrivalType ?? "0", - // orderNo: widget.patientLabOrders.orderNo, - // appointmentDate: widget.patientLabOrders.orderDate, - // doctorName: widget.patientLabOrders.doctorName, - // branch: widget.patientLabOrders.projectName, - // clinic: widget.patientLabOrders.clinicDescription, - // profileUrl: widget.patientLabOrders.doctorImageURL, - // invoiceNO: widget.patientLabOrders.invoiceNo, - // ), baseViewModel: model, body: AppScaffold( isShowAppBar: false, From 1a158f49bb7de67116f40b932619c35a5576b9d2 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Wed, 9 Jun 2021 16:23:18 +0300 Subject: [PATCH 057/124] no message --- ios/Runner/Base.lproj/Main.storyboard | 21 ++++++--- ios/Runner/MainAppViewController.swift | 11 +++-- ios/Runner/VCEmbeder.swift | 30 +++++++----- ios/Runner/VideoCallViewController.swift | 58 ++++++++++-------------- 4 files changed, 64 insertions(+), 56 deletions(-) diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index 17833007..9f1b5e1a 100755 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -39,6 +39,7 @@ + @@ -50,7 +51,7 @@ - + @@ -78,6 +79,11 @@ + + + + + @@ -134,6 +140,7 @@ + @@ -150,6 +157,7 @@ + @@ -160,20 +168,19 @@ + - - + + - - + + - - diff --git a/ios/Runner/MainAppViewController.swift b/ios/Runner/MainAppViewController.swift index c6466343..9a59b862 100644 --- a/ios/Runner/MainAppViewController.swift +++ b/ios/Runner/MainAppViewController.swift @@ -47,8 +47,10 @@ extension MainAppViewController : ICallProtocol{ func prepareVideoCallView(){ videoCallContainer = UIView(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: view.bounds.height)) - videoCallContainer.alpha = 0.0 videoCallContainer.backgroundColor = UIColor.black + videoCallContainer.isHidden = true + videoCallContainer.clipsToBounds = true + view.addSubview(videoCallContainer) setVideoViewConstrints() NSLayoutConstraint.activate(vdoCallViewMaxConstraint) @@ -97,12 +99,13 @@ extension MainAppViewController : ICallProtocol{ } private func showVideoCallView(_ value:Bool){ + videoCallContainer.alpha = value ? 0.0 : 1 + self.videoCallContainer.isHidden = !value + UIView.animate(withDuration: 0.5) { self.videoCallContainer.alpha = value ? 1.0 : 0.0 } completion: { complete in - if(value == false){ - self.videoCallContainer.removeFromSuperview() - } + self.videoCallContainer.isHidden = !value } } diff --git a/ios/Runner/VCEmbeder.swift b/ios/Runner/VCEmbeder.swift index e86dde75..7e2ea0fd 100644 --- a/ios/Runner/VCEmbeder.swift +++ b/ios/Runner/VCEmbeder.swift @@ -9,25 +9,31 @@ import Foundation extension UIView { - func fill(to parent: UIView) { - topAnchor.constraint(equalTo: parent.topAnchor).isActive = true - leadingAnchor.constraint(equalTo: parent.leadingAnchor).isActive = true - bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true - trailingAnchor.constraint(equalTo: parent.trailingAnchor).isActive = true + func fill(to parent: UIView, animateDuration:Double = 0.5) { + self.topAnchor.constraint(equalTo: parent.topAnchor).isActive = true + self.leadingAnchor.constraint(equalTo: parent.leadingAnchor).isActive = true + self.bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true + self.trailingAnchor.constraint(equalTo: parent.trailingAnchor).isActive = true + UIView.animate(withDuration: animateDuration) { + parent.layoutIfNeeded() + } } - func fillToParent() { + func fillToParent(animateDuration:Double = 0.5) { if let parent = self.superview{ - topAnchor.constraint(equalTo: parent.topAnchor).isActive = true - leadingAnchor.constraint(equalTo: parent.leadingAnchor).isActive = true - bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true - trailingAnchor.constraint(equalTo: parent.trailingAnchor).isActive = true + self.topAnchor.constraint(equalTo: parent.topAnchor).isActive = true + self.leadingAnchor.constraint(equalTo: parent.leadingAnchor).isActive = true + self.bottomAnchor.constraint(equalTo: parent.bottomAnchor).isActive = true + self.trailingAnchor.constraint(equalTo: parent.trailingAnchor).isActive = true + UIView.animate(withDuration: animateDuration) { + parent.layoutIfNeeded() + } } } - func fillTo(view:UIView) { + func fillInTo(view:UIView) { view.addSubview(self) - fill(to: view) + fillToParent() } } diff --git a/ios/Runner/VideoCallViewController.swift b/ios/Runner/VideoCallViewController.swift index a05957c9..689c9f63 100644 --- a/ios/Runner/VideoCallViewController.swift +++ b/ios/Runner/VideoCallViewController.swift @@ -101,17 +101,19 @@ class VideoCallViewController: UIViewController { sender.isSelected = minimized onMinimize?(minimized) - self.videoMuteBtn.isHidden = minimized - self.micMuteBtn.isHidden = minimized - let min_ = minimized - UIView.animate(withDuration: 1) { + UIView.animate(withDuration: 0.5) { self.actionsHeightConstraint.constant = min_ ? 30 : 60 self.localvideoTopMargin.constant = min_ ? 20 : 40 + self.videoMuteBtn.isHidden = min_ + self.micMuteBtn.isHidden = min_ - let vdoBound = self.localVideo.bounds - self.publisher?.view?.frame = CGRect(x: 0, y: 0, width: vdoBound.size.width, height: vdoBound.size.height) + let localVdoSize = self.localVideo.bounds.size + let remoteVdoSize = self.remoteVideo.bounds.size + self.publisher?.view?.frame = CGRect(x: 0, y: 0, width: localVdoSize.width, height: localVdoSize.height) + self.subscriber?.view?.frame = CGRect(x: 0, y: 0, width: remoteVdoSize.width, height: remoteVdoSize.height) self.publisher?.view?.layoutIfNeeded() + self.subscriber?.view?.layoutIfNeeded() } } @@ -324,14 +326,8 @@ class VideoCallViewController: UIViewController { extension VideoCallViewController: OTSessionDelegate { func sessionDidConnect(_ session: OTSession) { - print("The client connected to the OpenTok session.") - - - - - timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: (#selector(VideoCallViewController.updateTimer)), userInfo: nil, repeats: true) - - + print("The client connected to the OpenTok session.") + timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: (#selector(VideoCallViewController.updateTimer)), userInfo: nil, repeats: true) setupPublisher() } @@ -373,27 +369,23 @@ extension VideoCallViewController: OTSessionDelegate { func session(_ session: OTSession, streamCreated stream: OTStream) { - subscriber = OTSubscriber(stream: stream, delegate: self) - guard let subscriber = subscriber else { - return - } + subscriber = OTSubscriber(stream: stream, delegate: self) + guard let subscriber = subscriber else { + return + } - var error: OTError? - session.subscribe(subscriber, error: &error) - guard error == nil else { - print(error!) - return - } + var error: OTError? + session.subscribe(subscriber, error: &error) + guard error == nil else { + print(error!) + return + } - guard let subscriberView = subscriber.view else { - return - } - subscriberView.frame = UIScreen.main.bounds - view.insertSubview(subscriberView, at: 0) - -// if nil == subscriber { -// setupSubscribe(stream) -// } + guard let subscriberView = subscriber.view else { + return + } + subscriberView.frame = CGRect(x: 0, y: 0, width: remoteVideo.bounds.width, height: remoteVideo.bounds.height) + remoteVideo.addSubview(subscriberView) } func setupSubscribe(_ stream: OTStream?) { From 4cdc654348df8b084ba8877e658dbf3b5b67cdbe Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 9 Jun 2021 16:50:35 +0300 Subject: [PATCH 058/124] fix font size in header --- lib/widgets/patients/profile/GeneralLabResultHeader.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/widgets/patients/profile/GeneralLabResultHeader.dart b/lib/widgets/patients/profile/GeneralLabResultHeader.dart index 5f22459a..153a4ccf 100644 --- a/lib/widgets/patients/profile/GeneralLabResultHeader.dart +++ b/lib/widgets/patients/profile/GeneralLabResultHeader.dart @@ -224,13 +224,15 @@ class GeneralLabResultHeader extends StatelessWidget RichText( text: TextSpan( style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + fontSize: 14, fontFamily: 'Poppins')), new TextSpan( text: patient?.patientId?.toString() ?? "", style: TextStyle( From 10441e4af08fc3797376e1879d2f18fceacf3d0a Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 9 Jun 2021 17:10:39 +0300 Subject: [PATCH 059/124] referral changes --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 2 + .../referral/MyReferralPatientModel.dart | 7 +- .../patient/MyReferralPatientService.dart | 2 +- .../referral/AddReplayOnReferralPatient.dart | 131 ++++---- .../ReplySummeryOnReferralPatient.dart | 119 ++++++++ .../my-referral-inpatient-screen.dart | 1 - .../referral_patient_detail_in-paint.dart | 279 +++++++++++------- lib/util/translations_delegate_base.dart | 2 + .../patient-referral-item-widget.dart | 16 +- 10 files changed, 385 insertions(+), 176 deletions(-) create mode 100644 lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e2f9eb6a..eb946dea 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -181,7 +181,7 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUTPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; +const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 11f31ba6..4d0436aa 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1008,4 +1008,6 @@ const Map> localizedValues = { "allLab": {"en": "All Lab", "ar": "جميع المختبرات"}, "allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"}, "addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"}, + "edit": {"en": "Edit", "ar": "تعديل"}, + "summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"}, }; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 7aa375b8..ebf12857 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -159,7 +159,12 @@ class MyReferralPatientModel { referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; referralStatus = json["ReferralStatus"] is String ?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0: json["ReferralStatus"]; - referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']); + try { + referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']); + } catch (e){ + referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); + } + referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 9f29c4dc..39a75e8f 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -63,7 +63,7 @@ class MyReferralInPatientService extends BaseService { patientTypeID: 1); myReferralPatients.clear(); await baseAppClient.post( - GET_MY_REFERRAL_OUTPATIENT, + GET_MY_REFERRAL_OUT_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyOutPatientReferral'] != null) { response['List_MyOutPatientReferral'].forEach((v) { diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index f54a18ac..df941a5d 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -14,17 +14,24 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; +import 'ReplySummeryOnReferralPatient.dart'; + class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; + final bool isEdited; const AddReplayOnReferralPatient( - {Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) + {Key key, + this.patientReferralViewModel, + this.myReferralInPatientModel, + this.isEdited}) : super(key: key); @override @@ -39,10 +46,13 @@ class _AddReplayOnReferralPatientState var reconizedWord; var event = RobotProvider(); TextEditingController replayOnReferralController = TextEditingController(); + @override void initState() { requestPermissions(); super.initState(); + replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks?? ""; + } @override @@ -51,11 +61,9 @@ class _AddReplayOnReferralPatientState isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Padding( - padding: EdgeInsets.all(0.0), - child: Column( + child: Column( + children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle(title: 'Replay'), @@ -103,61 +111,70 @@ class _AddReplayOnReferralPatientState ), ], ), - ), - ), - ), - bottomSheet: Container( - height: replayOnReferralController.text.isNotEmpty ? 130 : 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Column( - children: [ - replayOnReferralController.text.isEmpty - ? SizedBox() - : Container( + Container( + height: replayOnReferralController.text.isNotEmpty ? 130 : 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + replayOnReferralController.text.isEmpty + ? SizedBox() + : Container( margin: EdgeInsets.all(5), child: Expanded( child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - replayOnReferralController.text = ''; - }); - }, - )), + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + replayOnReferralController.text = ''; + }); + }, + )), ), - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: 'Submit Replay', - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (replayOnReferralController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay( - replayOnReferralController.text.trim(), - widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.patientReferralViewModel.error); - } else { - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Replay Added Successfully"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - } else { - Helpers.showErrorToast("You can't add empty replay"); - setState(() { - isSubmitted = false; - }); - } - })), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: 'Submit Replay', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (replayOnReferralController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientReferralViewModel.replay( + replayOnReferralController.text.trim(), + widget.myReferralInPatientModel); + if (widget.patientReferralViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientReferralViewModel.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Replay Added Successfully"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + + Navigator.push( + context, + FadePage( + page: ReplySummeryOnReferralPatient( + widget.myReferralInPatientModel, + replayOnReferralController.text.trim()), + ), + ); + } + } else { + Helpers.showErrorToast("You can't add empty replay"); + setState(() { + isSubmitted = false; + }); + } + })), + ], + ), + ), ], ), ), diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart new file mode 100644 index 00000000..2a48e079 --- /dev/null +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -0,0 +1,119 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +class ReplySummeryOnReferralPatient extends StatefulWidget { + final MyReferralPatientModel referredPatient; + final String doctorReply; + + ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply); + + @override + _ReplySummeryOnReferralPatientState createState() => + _ReplySummeryOnReferralPatientState(this.referredPatient); +} + +class _ReplySummeryOnReferralPatientState + extends State { + final MyReferralPatientModel referredPatient; + + _ReplySummeryOnReferralPatientState(this.referredPatient); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).summeryReply, + body: Container( + child: Column( + children: [ + + Expanded( + child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: Colors.white, + width: 1.0, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).reply, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + widget.doctorReply ?? '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + ], + ), + ), + ), + ), + Container( + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: Row( + children: [ + Expanded( + child: AppButton( + onPressed: () { + Navigator.of(context).pop(); + }, + title: TranslationBase.of(context).cancel, + fontColor: Colors.white, + color: Colors.red[600], + ), + ), + SizedBox(width: 4,), + Expanded( + child: AppButton( + onPressed: () {}, + title: TranslationBase.of(context).noteConfirm, + fontColor: Colors.white, + color: Colors.green[600], + ), + ), + ], + ), + ), + ], + ), + ), + )); + } +} diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index 9813286e..636a596f 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -64,7 +64,6 @@ class MyReferralInPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( - margin: EdgeInsets.only(top: 70), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 0e7b214b..e2175bae 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -19,6 +19,7 @@ import 'AddReplayOnReferralPatient.dart'; class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; + ReferralPatientDetailScreen( this.referredPatient, this.patientReferralViewModel); @@ -214,30 +215,6 @@ class ReferralPatientDetailScreen extends StatelessWidget { Expanded( child: Column( children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).refClinic}: ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - AppText( - referredPatient - .referringClinicDescription, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), - ], - ), - if(referredPatient.frequency != null) Row( mainAxisAlignment: MainAxisAlignment.start, @@ -245,9 +222,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * @@ -257,7 +232,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { Expanded( child: AppText( referredPatient - .frequencyDescription??'', + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * @@ -267,6 +242,38 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ], ), + if (referredPatient.frequency != null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription ?? + '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * + SizeConfig + .textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), ], ), ), @@ -304,59 +311,69 @@ class ReferralPatientDetailScreen extends StatelessWidget { ) ], ), - if(referredPatient.priorityDescription != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).priority + - ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.priorityDescription??'', + if (referredPatient.priorityDescription != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority + + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, fontSize: - 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ), - if(referredPatient.mAXResponseTime != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.mAXResponseTime != null? AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"):'', + Expanded( + child: AppText( + referredPatient.priorityDescription ?? + '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + if (referredPatient.mAXResponseTime != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime + + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, fontSize: - 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ), + Expanded( + child: AppText( + referredPatient.mAXResponseTime != + null + ? AppDateUtils + .convertDateFromServerFormat( + referredPatient + .mAXResponseTime, + "dd MMM,yyyy") + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -448,48 +465,93 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: SingleChildScrollView( - child: Container( - width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - border: Border.fromBorderSide(BorderSide( - color: Colors.white, - width: 1.0, - )), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 2.4 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + child: Column( + children: [ + Container( + width: double.infinity, + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: Colors.white, + width: 1.0, + )), ), - AppText( - referredPatient.referringDoctorRemarks??'', - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + referredPatient.referringDoctorRemarks ?? '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + ], ), - SizedBox( - height: 8, + ), + if (referredPatient.referredDoctorRemarks.isNotEmpty) + Container( + width: double.infinity, + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 0), + padding: EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: Colors.white, + width: 1.0, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).reply, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + referredPatient.referredDoctorRemarks ?? '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + ], + ), ), - ], - ), + ], ), ), ), Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( - title: TranslationBase.of(context).replay, + title: referredPatient.referredDoctorRemarks.isEmpty ? TranslationBase.of(context).replay : TranslationBase.of(context).edit, color: Colors.red[700], fontColor: Colors.white, fontWeight: FontWeight.w700, @@ -503,6 +565,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { widget: AddReplayOnReferralPatient( patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, + isEdited: referredPatient.referredDoctorRemarks.isNotEmpty, ), ), ); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 16ae07bd..165a9bb5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1363,6 +1363,8 @@ class TranslationBase { String get allLab => localizedValues['allLab'][locale.languageCode]; String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; + String get edit => localizedValues['edit'][locale.languageCode]; + String get summeryReply => localizedValues['summeryReply'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 6e581954..02b2d241 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -155,6 +155,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), Row( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, @@ -163,13 +164,14 @@ class PatientReferralItemWidget extends StatelessWidget { fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), - - AppText( - !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + Expanded( + child: AppText( + !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), ), ], ), From 23feb2c354d304fbaa659c6e05a4fcd63baa8b98 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 9 Jun 2021 17:11:52 +0300 Subject: [PATCH 060/124] remove unused code --- .../vital_sign/vital-signs-screen.dart | 1074 ----------------- .../prescription/prescription_screen.dart | 591 --------- .../prescription_screen_history.dart | 516 -------- .../profile/patient-page-header-widget.dart | 114 -- 4 files changed, 2295 deletions(-) delete mode 100644 lib/screens/patients/profile/vital_sign/vital-signs-screen.dart delete mode 100644 lib/screens/prescription/prescription_screen.dart delete mode 100644 lib/screens/prescription/prescription_screen_history.dart delete mode 100644 lib/widgets/patients/profile/patient-page-header-widget.dart diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart deleted file mode 100644 index 0bf2197b..00000000 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ /dev/null @@ -1,1074 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.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/profile/patient-page-header-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/expandable-widget-header-body.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class PatientVitalSignScreen extends StatelessWidget { - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String from = routeArgs['from']; - String to = routeArgs['to']; - - return BaseView( - onModelReady: (model) => model.getPatientVitalSign(patient), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).vitalSign, - body: model.patientVitalSigns != null - ? SingleChildScrollView( - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - PatientPageHeaderWidget(patient), - SizedBox( - height: 16, - ), - Container( - margin: - EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).weight} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.weightKg} ${TranslationBase.of(context).kg}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).idealBodyWeight} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.idealBodyWeightLbs} ${TranslationBase.of(context).kg}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).height} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.heightCm} ${TranslationBase.of(context).cm}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - /*Row( - children: [ - AppText( - "${TranslationBase.of(context).waistSize} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.waistSizeInch} ${TranslationBase.of(context).inch}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ),*/ - Row( - children: [ - AppText( - "${TranslationBase.of(context).headCircum} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.headCircumCm} ${TranslationBase.of(context).cm}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 16, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).leanBodyWeight} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.leanBodyWeightLbs} ${TranslationBase.of(context).kg}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).bodyMassIndex} :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.bodyMassIndex}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - SizedBox( - width: 8, - ), - Container( - color: Colors.green, - child: Padding( - padding: EdgeInsets.symmetric( - vertical: 2, horizontal: 8), - child: AppText( - "${model.getBMI(model.patientVitalSigns.bodyMassIndex)}", - fontSize: - SizeConfig.textMultiplier * 2, - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ) - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "G.C.S :", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 8, - ), - AppText( - "N/A", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - TemperatureWidget(model, model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - PulseWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - RespirationWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - BloodPressureWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - OxygenationWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - PainScaleWidget(model.patientVitalSigns), - SizedBox( - height: 16, - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 16, - ), - ], - ), - ) - ], - ), - ), - ) - : Center( - child: AppText( - "${TranslationBase.of(context).vitalSignEmptyMsg}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: HexColor("#B8382B"), - fontWeight: FontWeight.normal, - ), - ), - ), - ); - } -} - -class TemperatureWidget extends StatefulWidget { - final VitalSignsViewModel model; - final VitalSignData vitalSign; - - TemperatureWidget(this.model, this.vitalSign); - - @override - _TemperatureWidgetState createState() => _TemperatureWidgetState(); -} - -class _TemperatureWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).temperature} (C):", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.temperatureCelcius}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).temperature} (F):", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).method} :", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.model.getTempratureMethod(widget.vitalSign.temperatureCelciusMethod)}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class PulseWidget extends StatefulWidget { - final VitalSignData vitalSign; - - PulseWidget(this.vitalSign); - - @override - _PulseWidgetState createState() => _PulseWidgetState(); -} - -class _PulseWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).pulse}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).pulseBeats}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.pulseBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).rhythm}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.pulseRhythm}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class RespirationWidget extends StatefulWidget { - final VitalSignData vitalSign; - - RespirationWidget(this.vitalSign); - - @override - _RespirationWidgetState createState() => _RespirationWidgetState(); -} - -class _RespirationWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).respiration}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).respBeats}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.respirationBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).patternOfRespiration}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.respirationPattern}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class BloodPressureWidget extends StatefulWidget { - final VitalSignData vitalSign; - - BloodPressureWidget(this.vitalSign); - - @override - _BloodPressureWidgetState createState() => _BloodPressureWidgetState(); -} - -class _BloodPressureWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).bloodPressure}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).bloodPressureDiastoleAndSystole}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).cuffLocation}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.bloodPressureCuffLocation}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).patientPosition}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: AppText( - "${widget.vitalSign.bloodPressurePatientPosition}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ), - ], - ), - ), - Expanded( - child: Row( - children: [ - AppText( - "${TranslationBase.of(context).cuffSize}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.bloodPressureCuffSize}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class OxygenationWidget extends StatefulWidget { - final VitalSignData vitalSign; - - OxygenationWidget(this.vitalSign); - - @override - _OxygenationWidgetState createState() => _OxygenationWidgetState(); -} - -class _OxygenationWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).oxygenation}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).sao2}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.sao2}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).fio2}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.fio2}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} - -class PainScaleWidget extends StatefulWidget { - final VitalSignData vitalSign; - - PainScaleWidget(this.vitalSign); - - @override - _PainScaleWidgetState createState() => _PainScaleWidgetState(); -} - -class _PainScaleWidgetState extends State { - bool isExpand = false; - - @override - Widget build(BuildContext context) { - return Container( - child: HeaderBodyExpandableNotifier( - headerWidget: Container( - margin: EdgeInsets.symmetric(vertical: 16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - fontWeight: isExpand ? FontWeight.bold : FontWeight.normal, - ), - InkWell( - onTap: () { - setState(() { - isExpand = !isExpand; - }); - }, - child: Icon(isExpand ? Icons.remove : Icons.add), - ), - ], - ), - ), - bodyWidget: Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.painScore}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ), - Expanded( - child: Row( - children: [ - AppText( - "${TranslationBase.of(context).painManagement}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.isPainManagementDone}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ), - ], - ), - ], - ), - ), - isExpand: isExpand, - ), - ); - } -} diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart deleted file mode 100644 index d5a94c61..00000000 --- a/lib/screens/prescription/prescription_screen.dart +++ /dev/null @@ -1,591 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; -import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-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/network_base_view.dart'; -import 'package:flutter/material.dart'; - -class NewPrescriptionScreen extends StatefulWidget { - @override - _NewPrescriptionScreenState createState() => _NewPrescriptionScreenState(); -} - -class _NewPrescriptionScreenState extends State { - PersistentBottomSheetController _controller; - TextEditingController strengthController = TextEditingController(); - int testNum = 0; - int strengthChar; - PatiantInformtion patient; - - @override - void initState() { - super.initState(); - } - - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - return BaseView( - onModelReady: (model) => model.getPrescription(mrn: patient.patientId), - builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: Column( - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.prescriptionList.length != 0) - ? SizedBox(height: model.prescriptionList[0].rowcount == 0 ? 200.0 : 10.0) - : SizedBox(height: 200.0), - //model.prescriptionList == null - (model.prescriptionList.length != 0) - ? model.prescriptionList[0].rowcount == 0 - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - addPrescriptionForm(context, model, patient, model.prescriptionList); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).noPrescriptionListed, - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, - ), - ], - ), - ], - ) - : Padding( - padding: EdgeInsets.all(14.0), - child: NetworkBaseView( - baseViewModel: model, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - InkWell( - child: Container( - height: 50.0, - width: 450.0, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(10.0), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - ' Add more medication', - fontWeight: FontWeight.w100, - fontSize: 12.5, - ), - Icon( - Icons.add, - color: Color(0XFFB8382C), - ) - ], - ), - ), - ), - onTap: () { - addPrescriptionForm(context, model, patient, model.prescriptionList); - //model.postPrescription(); - }, - ), - SizedBox( - height: 10.0, - ), - ...List.generate( - model.prescriptionList[0].rowcount, - (index) => Container( - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: MediaQuery.of(context).size.height * 0.022, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: - // CrossAxisAlignment.start, - children: [ - Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.21, - width: MediaQuery.of(context).size.width * 0.1, - child: Column( - children: [ - AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index] - .createdOn) != - null - ? (DateTime.parse(model.prescriptionList[0] - .entityList[index].createdOn) - .year) - .toString() - : DateTime.now().year) - .toString(), - color: Colors.green, - fontSize: 13.5, - ), - AppText( - AppDateUtils.getMonth(model.prescriptionList[0] - .entityList[index].createdOn != - null - ? (DateTime.parse(model.prescriptionList[0] - .entityList[index].createdOn) - .month) - : DateTime.now().month) - .toUpperCase(), - color: Colors.green, - ), - AppText( - DateTime.parse( - model.prescriptionList[0].entityList[index].createdOn) - .day - .toString(), - color: Colors.green, - ), - AppText( - AppDateUtils.getTimeFormated(DateTime.parse(model - .prescriptionList[0].entityList[index].createdOn)) - .toString(), - color: Colors.green, - ), - ], - ), - ), - Container( - color: Colors.white, - // height: MediaQuery.of( - // context) - // .size - // .height * - // 0.3499, - width: MediaQuery.of(context).size.width * 0.77, - child: Column( - children: [ - Row( - children: [ - AppText( - 'Start Date:', - fontWeight: FontWeight.w700, - fontSize: 14.0, - ), - Expanded( - child: AppText( - AppDateUtils.getDateFormatted(DateTime.parse(model - .prescriptionList[0].entityList[index].startDate)), - fontSize: 13.5, - ), - ), - SizedBox( - width: 6.0, - ), - AppText( - 'Order Type:', - fontWeight: FontWeight.w700, - fontSize: 14.0, - ), - Expanded( - child: AppText( - model.prescriptionList[0].entityList[index] - .orderTypeDescription, - fontSize: 13.0, - ), - ), - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Container( - color: Colors.white, - child: Expanded( - child: AppText( - model.prescriptionList[0].entityList[index] - .medicationName, - fontWeight: FontWeight.w700, - fontSize: 15.0, - ), - ), - ) - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Expanded( - child: AppText( - model.prescriptionList[0].entityList[index].doseDetail, - fontSize: 15.0, - ), - ) - ], - ), - SizedBox( - height: 10.0, - ), - Row( - children: [ - AppText( - 'Indication: ', - fontWeight: FontWeight.w700, - fontSize: 17.0, - ), - Expanded( - child: RichText( - maxLines: 3, - overflow: TextOverflow.ellipsis, - strutStyle: StrutStyle(fontSize: 12.0), - text: TextSpan( - style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index] - .indication), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'UOM: ', - fontWeight: FontWeight.w700, - fontSize: 17.0, - ), - Expanded( - child: RichText( - maxLines: 3, - overflow: TextOverflow.ellipsis, - strutStyle: StrutStyle(fontSize: 12.0), - text: TextSpan( - style: TextStyle(color: Colors.black), - text: model - .prescriptionList[0].entityList[index].uom), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'BOX Quantity: ', - fontWeight: FontWeight.w700, - fontSize: 17.0, - ), - Expanded( - child: RichText( - maxLines: 3, - overflow: TextOverflow.ellipsis, - strutStyle: StrutStyle(fontSize: 12.0), - text: TextSpan( - style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index] - .quantity - .toString() == - null - ? "" - : model.prescriptionList[0].entityList[index] - .quantity - .toString()), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'pharmacy Intervention ', - fontWeight: FontWeight.w700, - fontSize: 17.0, - ), - Expanded( - child: RichText( - maxLines: 3, - overflow: TextOverflow.ellipsis, - strutStyle: StrutStyle(fontSize: 12.0), - text: TextSpan( - style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index] - .pharmacyInervention == - null - ? "" - : model.prescriptionList[0].entityList[index] - .pharmacyInervention - .toString()), - ), - ), - ], - ), - SizedBox(height: 5.0), - Row( - children: [ - AppText( - 'pharmacist Remarks : ', - fontWeight: FontWeight.w700, - fontSize: 15.0, - ), - Expanded( - child: AppText( - model.prescriptionList[0].entityList[index] - .pharmacistRemarks == - null - ? "" - : model.prescriptionList[0].entityList[index] - .pharmacistRemarks, - fontSize: 15.0), - ) - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).doctorName + ": ", - fontWeight: FontWeight.w600, - ), - Expanded( - child: AppText( - model.prescriptionList[0].entityList[index].doctorName, - fontWeight: FontWeight.w700, - ), - ) - ], - ), - SizedBox( - height: 8.0, - ), - Row( - children: [ - AppText( - 'Doctor Remarks : ', - fontWeight: FontWeight.w700, - fontSize: 13.0, - ), - Expanded( - child: Container( - color: Colors.white, - // height: MediaQuery.of(context).size.height * - // 0.038, - child: RichText( - // maxLines: - // 2, - // overflow: - // TextOverflow.ellipsis, - strutStyle: StrutStyle(fontSize: 10.0), - text: TextSpan( - style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index] - .remarks != - null - ? model.prescriptionList[0].entityList[index] - .remarks - : "", - ), - ), - ), - ), - ], - ), - SizedBox( - height: 10.0, - ), - - // SizedBox( - // height: 40, - // ), - ], - ), - ), - Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.16, - width: MediaQuery.of(context).size.width * 0.06, - child: Column( - children: [ - InkWell( - child: Icon(Icons.edit), - onTap: () { - updatePrescriptionForm( - box: model - .prescriptionList[0].entityList[index].quantity, - uom: model.prescriptionList[0].entityList[index].uom, - drugNameGeneric: model.prescriptionList[0] - .entityList[index].medicationName, - doseUnit: model.prescriptionList[0].entityList[index] - .doseDailyUnitID - .toString(), - doseStreangth: model.prescriptionList[0] - .entityList[index].doseDailyQuantity - .toString(), - duration: model.prescriptionList[0].entityList[index] - .doseDurationDays - .toString(), - startDate: model - .prescriptionList[0].entityList[index].startDate - .toString(), - dose: model.prescriptionList[0].entityList[index].doseTimingID - .toString(), - frequency: model - .prescriptionList[0].entityList[index].frequencyID - .toString(), - rouat: model.prescriptionList[0].entityList[index].routeID - .toString(), - patient: patient, - drugId: model.prescriptionList[0].entityList[index].medicineCode, - drugName: model.prescriptionList[0].entityList[index].medicationName, - remarks: model.prescriptionList[0].entityList[index].remarks, - model: model, - enteredRemarks: model.prescriptionList[0].entityList[index].remarks, - context: context); - //model.postPrescription(); - }, - ), - ], - ), - ), - ], - ), - Divider( - height: 0, - thickness: 1.0, - color: Colors.grey, - ), - ], - ), - ), - ), - ], - ), - ), - ) - : Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - addPrescriptionForm(context, model, patient, model.prescriptionList); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, - ), - ), - ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).noPrescriptionListed, - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, - ), - ], - ), - ], - ) - ], - ), - ), - ), - )), - ); - } - - selectDate(BuildContext context, PrescriptionViewModel model) async { - DateTime selectedDate; - selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime.now().add(Duration(hours: 2)), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != selectedDate) { - setState(() { - selectedDate = picked; - }); - } - } -} diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart deleted file mode 100644 index 5ce98c54..00000000 --- a/lib/screens/prescription/prescription_screen_history.dart +++ /dev/null @@ -1,516 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-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/network_base_view.dart'; -import 'package:flutter/material.dart'; - -class NewPrescriptionHistoryScreen extends StatefulWidget { - @override - _NewPrescriptionHistoryScreenState createState() => - _NewPrescriptionHistoryScreenState(); -} - -class _NewPrescriptionHistoryScreenState - extends State { - PersistentBottomSheetController _controller; - final _scaffoldKey = GlobalKey(); - TextEditingController strengthController = TextEditingController(); - int testNum = 0; - int strengthChar; - PatiantInformtion patient; - - @override - void initState() { - super.initState(); - } - - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - return BaseView( - onModelReady: (model) => model.getPrescription(mrn: patient.patientId), - builder: - (BuildContext context, PrescriptionViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: Column( - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.prescriptionList.length != 0) - ? SizedBox( - height: - model.prescriptionList[0].rowcount == 0 - ? 200.0 - : 10.0) - : SizedBox(height: 200.0), - //model.prescriptionList == null - (model.prescriptionList.length != 0) - ? model.prescriptionList[0].rowcount == 0 - ? Container( - child: AppText( - 'Sorry , Theres no prescriptions for this patient', - color: Color(0xFFB9382C), - ), - ) - : Padding( - padding: EdgeInsets.all(14.0), - child: NetworkBaseView( - baseViewModel: model, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - ...List.generate( - model.prescriptionList[0] - .rowcount, - (index) => Container( - color: Colors.white, - child: Column( - children: [ - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.022, - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - // crossAxisAlignment: - // CrossAxisAlignment.start, - children: [ - Container( - height: MediaQuery.of( - context) - .size - .height * - 0.21, - width: MediaQuery.of( - context) - .size - .width * - 0.1, - child: Column( - children: [ - AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) - .toString() - : DateTime.now() - .year) - .toString(), - color: Colors - .green, - fontSize: - 13.5, - ), - AppText( - AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) - .month) - : DateTime.now() - .month) - .toUpperCase(), - color: Colors - .green, - ), - AppText( - DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn) - .day - .toString(), - color: Colors - .green, - ), - AppText( - AppDateUtils.getTimeFormated(DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn)) - .toString(), - color: Colors - .green, - ), - ], - ), - ), - Container( - // height: MediaQuery.of( - // context) - // .size - // .height * - // 0.3499, - width: MediaQuery.of( - context) - .size - .width * - 0.77, - child: Column( - children: [ - Row( - children: [ - AppText( - 'Start Date:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - AppDateUtils.getDateFormatted(DateTime.parse(model - .prescriptionList[0] - .entityList[index] - .startDate)), - fontSize: - 13.5, - ), - ), - SizedBox( - width: - 6.0, - ), - AppText( - 'Order Type:', - fontWeight: - FontWeight - .w700, - fontSize: - 14.0, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .orderTypeDescription, - fontSize: - 13.0, - ), - ), - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Container( - child: - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .medicationName, - fontWeight: - FontWeight.w700, - fontSize: - 15.0, - ), - ), - ) - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doseDetail, - fontSize: - 15.0, - ), - ) - ], - ), - SizedBox( - height: 10.0, - ), - Row( - children: [ - AppText( - 'Indication: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].indication), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'UOM: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].uom), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'BOX Quantity: ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), - ), - ), - ], - ), - Row( - children: [ - AppText( - 'pharmacy Intervention ', - fontWeight: - FontWeight - .w700, - fontSize: - 17.0, - ), - Expanded( - child: - RichText( - maxLines: - 3, - overflow: - TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 12.0), - text: TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), - ), - ), - ], - ), - SizedBox( - height: - 5.0), - Row( - children: [ - AppText( - 'pharmacist Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - Expanded( - child: AppText( - // commening below code because there is an error coming in the model please fix it before pushing it - model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, - fontSize: 15.0), - ) - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .doctorName + - ": ", - fontWeight: - FontWeight - .w600, - ), - Expanded( - child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .doctorName, - fontWeight: - FontWeight.w700, - ), - ) - ], - ), - SizedBox( - height: 8.0, - ), - Row( - children: [ - AppText( - 'Doctor Remarks : ', - fontWeight: - FontWeight - .w700, - fontSize: - 13.0, - ), - Expanded( - child: - Container( - // height: MediaQuery.of(context).size.height * - // 0.038, - child: - RichText( - // maxLines: - // 2, - // overflow: - // TextOverflow.ellipsis, - strutStyle: - StrutStyle(fontSize: 10.0), - text: - TextSpan( - style: - TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].remarks != null - ? model.prescriptionList[0].entityList[index].remarks - : "", - ), - ), - ), - ), - ], - ), - SizedBox( - height: 10.0, - ), - - // SizedBox( - // height: 40, - // ), - ], - ), - ), - ], - ), - Divider( - height: 0, - thickness: 1.0, - color: Colors.grey, - ), - ], - ), - ), - ), - ], - ), - ), - ) - : Container( - child: AppText( - 'Sorry , theres no prescriptions listed for this patient', - color: Color(0xFFB9382C), - ), - ) - ], - ), - ), - ), - )), - ); - } - - selectDate(BuildContext context, PrescriptionViewModel model) async { - DateTime selectedDate; - selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime.now().add(Duration(hours: 2)), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != selectedDate) { - setState(() { - selectedDate = picked; - }); - } - } -} diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart deleted file mode 100644 index 49ad8f4e..00000000 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ /dev/null @@ -1,114 +0,0 @@ -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_screen.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'; -import 'package:provider/provider.dart'; - -class PatientPageHeaderWidget extends StatelessWidget { - - final PatiantInformtion patient; - PatientPageHeaderWidget(this.patient); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - - return BaseView( - onModelReady: (model) async { - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patient.patientMRN??patient.patientId, - doctorID: '', - editedBy: ''); - await model.getPatientAllergy(generalGetReqForSOAP); - if (model.allergiesList.length == 0) { - await model.getMasterLookup(MasterKeysService.Allergies); - } - if (model.allergySeverityList.length == 0) { - await model.getMasterLookup(MasterKeysService.AllergySeverity); - } - - }, - builder: (_, model, w) => Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - AppText( - patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age , - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 20, - ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText( - TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ) : AppText(''), - ], - ), - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - width: 20, - ), - ], - ), - )); - } -} From ca0cc745d5a3647d03db6a912c9e2890a1608baf Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 9 Jun 2021 17:15:23 +0300 Subject: [PATCH 061/124] remove headers --- ...-profile-header-new-design_in_patient.dart | 242 --------- ..._profile_header_with_appointment_card.dart | 507 ------------------ 2 files changed, 749 deletions(-) delete mode 100644 lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart delete mode 100644 lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart deleted file mode 100644 index c3a8638f..00000000 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ /dev/null @@ -1,242 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.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'; -import 'package:intl/intl.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final double height; - - PatientProfileHeaderNewDesignInPatient( - this.patient, this.patientType, this.arrivalType, - {this.height = 0.0}); - - @override - Widget build(BuildContext context) { - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; - } else { - gender = patient.gender; - } - - return Container( - padding: EdgeInsets.only( - left: 0, - right: 5, - bottom: 5, - ), - decoration: BoxDecoration( - color: Colors.white, - ), - height: height == 0 ? 200 : height, - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - // margin: EdgeInsets.only(top: 50), - child: Column( - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - ), - gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 4), - child: InkWell( - onTap: () { - launch("tel://" + patient.mobileNumber); - }, - child: Icon( - Icons.phone, - color: Colors.black87, - ), - ), - ), - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).fileNumber, - fontSize: 1.2 * SizeConfig.textMultiplier, - ), - AppText(patient.patientId.toString(), - fontSize: 1.4 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700), - ], - ), - if(patient.admissionDate!=null) - Row( - children: [ - AppText( - AppDateUtils.convertDateFromServerFormat( - patient.admissionDate, "hh:mm a"), - fontWeight: FontWeight.bold, - fontSize: 1.4 * SizeConfig.textMultiplier, - ), - ], - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if(patient.admissionDate!=null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).admissionDate}: ", - fontSize: 1.2 * SizeConfig.textMultiplier, - ), - AppText( - AppDateUtils.convertDateFromServerFormat( - patient.admissionDate, "dd MMM,yyyy"), - fontSize: 1.4 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700), - ], - ), - Row( - children: [ - AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', - fontWeight: FontWeight.bold, - fontSize: 1.4 * SizeConfig.textMultiplier, - ), - patient.nationalityFlagURL != null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - patient.nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - if(patient.admissionDate!=null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 1.2 * SizeConfig.textMultiplier, - ), - AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", - fontSize: 1.4 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700), - ], - ), - ], - ), - ), - ]), - ], - ), - ), - ); - } - - convertDateFormat2(String str) { - String newDate; - const start = "/Date("; - if (str.isNotEmpty) { - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - } - - return newDate.toString(); - } - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } -} diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart deleted file mode 100644 index f3e01316..00000000 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ /dev/null @@ -1,507 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.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'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import 'large_avatar.dart'; - -class PatientProfileHeaderWhitAppointment extends StatelessWidget { - - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final bool isPrescriptions; - final String clinic; - PatientProfileHeaderWhitAppointment( - {this.patient, - this.patientType, - this.arrivalType, - this.doctorName, - this.branch, - this.appointmentDate, - this.profileUrl, - this.invoiceNO, - this.orderNo, this.isPrescriptions = false, this.clinic}); - - @override - Widget build(BuildContext context) { - int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; - } else { - gender = patient.gender; - } - - ProjectViewModel projectViewModel = Provider.of(context); - return Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - //height: 300, - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - patient.firstName != null ? - (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize( - patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier *2.2, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - ), - gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 4), - child: InkWell( - onTap: () { - launch("tel://" + patient.mobileNumber); - }, - child: Icon( - Icons.phone, - color: Colors.black87, - ), - ), - ) - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SERVICES_PATIANT2[ - int.parse(patientType)] == - "patientArrivalList" - ? Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - patient.patientStatusType == - 43 - ? AppText( - TranslationBase.of( - context) - .arrivedP, - color: Colors.green, - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of( - context) - .notArrived, - color: - Colors.red[800], - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ), - arrivalType == '1' || patient.arrivedOn == null - ? AppText( - patient.startTime != - null - ? patient - .startTime - : '', - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - : AppText( - AppDateUtils.convertStringToDateFormat( - patient - .arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - ], - )) - : SizedBox(), - if (SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient") - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .appointmentDate + - " : ", - fontSize: 14, - ), - patient.startTime != null - ? Container( - height: 15, - width: 60, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 25), - color: HexColor( - "#20A169"), - ), - child: AppText( - patient.startTime, - color: Colors.white, - fontSize: 1.5 * - SizeConfig - .textMultiplier, - textAlign: TextAlign - .center, - fontWeight: - FontWeight.bold, - ), - ) - : SizedBox(), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(patient.appointmentDate.toString()?? ''), - fontSize: 1.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold, - ), - ), - SizedBox( - height: 0.5, - ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig - .textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: - TranslationBase.of( - context) - .fileNumber, - style: TextStyle( - fontSize: 12, - fontFamily: - 'Poppins')), - new TextSpan( - text: patient.patientId - .toString(), - style: TextStyle( - fontWeight: - FontWeight.w700, - fontFamily: - 'Poppins', - fontSize: 14)), - ], - ), - ), - Row( - children: [ - AppText( - patient.nationalityName ?? - patient.nationality??"", - fontWeight: FontWeight.bold, - fontSize: 12, - ), - patient.nationality != null - ? ClipRRect( - borderRadius: - BorderRadius - .circular( - 20.0), - child: Image.network( - patient.nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: - (BuildContext - context, - Object - exception, - StackTrace - stackTrace) { - return Text( - 'No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .age + - " : ", - style: TextStyle( - fontSize: 14)), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}", - style: TextStyle( - fontWeight: - FontWeight.w700, - fontSize: 14)), - ], - ), - ), - ), - ], - ), - ), - ]), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 30, - height: 30, - margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border( - bottom:BorderSide(color: Colors.grey[400],width: 2.5), - left: BorderSide(color: Colors.grey[400],width: 2.5), - ) - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: LargeAvatar( - name: doctorName, - url: profileUrl, - ), - width: 25, - height: 25, - margin: EdgeInsets.only(top: 10), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - '${TranslationBase.of(context).dr}.$doctorName', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - 'Order No:', - color: Colors.grey[800], - ), - AppText( - orderNo ?? '', - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - 'Invoice:', - color: Colors.grey[800], - ), - AppText( - invoiceNO, - ) - ], - ), - if(isPrescriptions) - Row( - children: [ - AppText( - 'Branch:', - color: Colors.grey[800], - ), - AppText( - branch?? '', - ) - ], - ), - if(isPrescriptions) - Row( - children: [ - AppText( - 'Clinic:', - color: Colors.grey[800], - ), - AppText( - clinic?? '', - ) - ], - ), - Row( - children: [ - AppText( - !isPrescriptions? 'Result Date:': 'Prescriptions Date', - color: Colors.grey[800], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - ), - ) - ], - ) - ]), - ), - ), - - ], - ), - ), - ), - ], - ) - ], - ), - ), - ); - } - - convertDateFormat2(String str) { - String newDate =""; - const start = "/Date("; - const end = "+0300)"; - - if (str.isNotEmpty) { - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - } - - return newDate.toString(); - } - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } -} From 017669c406e4868b7fe64084806240beecea37cc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 10 Jun 2021 09:51:34 +0300 Subject: [PATCH 062/124] Merge branch 'development' into procedure_refactoring # Conflicts: # lib/core/service/patient/LiveCarePatientServices.dart --- .../referral/MyReferralPatientModel.dart | 2 + .../my_referred_patient_model.dart | 4 +- .../referral/AddReplayOnReferralPatient.dart | 212 +++++++++--------- 3 files changed, 111 insertions(+), 107 deletions(-) diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index ebf12857..ac069e8d 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -163,6 +163,8 @@ class MyReferralPatientModel { referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']); } catch (e){ referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); + } finally { + referralDate = DateTime.now(); } referringDoctorRemarks = json['ReferringDoctorRemarks']; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index cb61975a..b353e587 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -166,8 +166,9 @@ class MyReferredPatientModel { referringDoctor = json['ReferringDoctor']; referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; + createdOn = json['CreatedOn']; referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus']; - referralDate = json['ReferralDate']; + referralDate = json['ReferralDate'] ?? createdOn; referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; referralResponseOn = json['ReferralResponseOn']; @@ -179,7 +180,6 @@ class MyReferredPatientModel { appointmentDate = json['AppointmentDate']; appointmentType = json['AppointmentType']; patientMRN = json['PatientMRN']; - createdOn = json['CreatedOn']; clinicID = json['ClinicID']; nationalityID = json['NationalityID']; age = json['Age']; diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 97db3d40..aadcd5f0 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -51,8 +51,8 @@ class _AddReplayOnReferralPatientState void initState() { requestPermissions(); super.initState(); - replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks?? ""; - + replayOnReferralController.text = + widget.myReferralInPatientModel.referredDoctorRemarks ?? ""; } @override @@ -60,67 +60,70 @@ class _AddReplayOnReferralPatientState return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle(title: 'Reply'), - SizedBox( - height: 10.0, - ), - Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Stack( - children: [ - AppTextFieldCustom( - hintText: 'Reply your responses here', - controller: replayOnReferralController, - maxLines: 35, - minLines: 25, - hasBorder: true, - validationError: - replayOnReferralController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - Positioned( - top: 0, //MediaQuery.of(context).size.height * 0, - right: 15, - child: IconButton( - icon: Icon( - DoctorApp.speechtotext, - color: Colors.black, - size: 35, - ), - onPressed: () { - onVoiceText(); - }, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle(title: 'Reply'), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Stack( + children: [ + AppTextFieldCustom( + hintText: 'Reply your responses here', + controller: replayOnReferralController, + maxLines: 35, + minLines: 25, + hasBorder: true, + validationError: replayOnReferralController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), - ) - ], - ), - ], + Positioned( + top: 0, + //MediaQuery.of(context).size.height * 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + size: 35, + ), + onPressed: () { + onVoiceText(); + }, + ), + ) + ], + ), + ], + ), ), ), - ), - ], + ], + ), ), - Container( - height: replayOnReferralController.text.isNotEmpty ? 130 : 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Column( - children: [ - replayOnReferralController.text.isEmpty - ? SizedBox() - : Container( - margin: EdgeInsets.all(5), - child: Expanded( + ), + Container( + height: replayOnReferralController.text.isNotEmpty ? 130 : 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + replayOnReferralController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), child: AppButton( title: TranslationBase.of(context).clearText, onPressed: () { @@ -128,55 +131,54 @@ class _AddReplayOnReferralPatientState replayOnReferralController.text = ''; }); }, - )), - ), - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: 'Submit Reply', - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (replayOnReferralController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay( - replayOnReferralController.text.trim(), - widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.patientReferralViewModel.error); - } else { - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Reply Added Successfully"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - - Navigator.push( - context, - FadePage( - page: ReplySummeryOnReferralPatient( - widget.myReferralInPatientModel, - replayOnReferralController.text.trim()), - ), - ); - } + ), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: 'Submit Reply', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (replayOnReferralController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientReferralViewModel.replay( + replayOnReferralController.text.trim(), + widget.myReferralInPatientModel); + if (widget.patientReferralViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientReferralViewModel.error); } else { - Helpers.showErrorToast("You can't add empty reply"); - setState(() { - isSubmitted = false; - }); + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Reply Added Successfully"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + + Navigator.push( + context, + FadePage( + page: ReplySummeryOnReferralPatient( + widget.myReferralInPatientModel, + replayOnReferralController.text.trim()), + ), + ); } - })), - ], - ), + } else { + Helpers.showErrorToast("You can't add empty reply"); + setState(() { + isSubmitted = false; + }); + } + })), + ], ), - ], - ), + ), + ], ), ); } From 42a4f9330ac5819f6f763b2c84ea9570af2dd16f Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Thu, 10 Jun 2021 10:12:58 +0300 Subject: [PATCH 063/124] no message --- ios/Podfile | 1 + ios/Runner.xcodeproj/project.pbxproj | 4 ++++ ios/Runner/Base.lproj/Main.storyboard | 16 +++++++++++++--- ios/Runner/Extensions.swift | 20 ++++++++++++++++++++ ios/Runner/MainAppViewController.swift | 10 ++++++++-- ios/Runner/VideoCallViewController.swift | 18 +++++++++++++----- 6 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 ios/Runner/Extensions.swift diff --git a/ios/Podfile b/ios/Podfile index 62207805..c2335042 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -65,6 +65,7 @@ target 'Runner' do pod 'Flutter', :path => 'Flutter' pod 'OpenTok' pod 'Alamofire', '~> 5.2' + pod 'AADraggableView' # Plugin Pods # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0e446318..66be39bf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 29211E4225C172B700DD740D /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 29211E4125C172B700DD740D /* GoogleService-Info.plist */; }; 300790FA266FB14B0052174C /* VCEmbeder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 300790F9266FB14B0052174C /* VCEmbeder.swift */; }; + 300790FC26710CAB0052174C /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 300790FB26710CAB0052174C /* Extensions.swift */; }; 30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; }; 30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; @@ -41,6 +42,7 @@ 29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = ""; }; 29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = ""; }; + 300790FB26710CAB0052174C /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = ""; }; 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallRequestParameters.swift; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; @@ -78,6 +80,7 @@ isa = PBXGroup; children = ( 300790F9266FB14B0052174C /* VCEmbeder.swift */, + 300790FB26710CAB0052174C /* Extensions.swift */, ); name = helpers; sourceTree = ""; @@ -326,6 +329,7 @@ 300790FA266FB14B0052174C /* VCEmbeder.swift in Sources */, 30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 300790FC26710CAB0052174C /* Extensions.swift in Sources */, 9CE61EBD24AB366E008D68DD /* VideoCallViewController.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 9CE61ECD24ADBB4C008D68DD /* ICallProtocoll.swift in Sources */, diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index 9f1b5e1a..12e173a7 100755 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -48,7 +48,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -98,6 +98,11 @@ + + + + + @@ -237,7 +242,7 @@ - + @@ -282,6 +287,11 @@ + + + + + + + + + - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - + + - + - + + + + - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - - - - - - - diff --git a/ios/Runner/MainAppViewController.swift b/ios/Runner/MainAppViewController.swift index 35ef4e1b..a6e4bcea 100644 --- a/ios/Runner/MainAppViewController.swift +++ b/ios/Runner/MainAppViewController.swift @@ -32,8 +32,10 @@ class MainAppViewController: FlutterViewController{ videoCallChannel.setMethodCallHandler({ (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in switch call.method { - case "openVideoCall": - self.startVideoCall(result: result, call: call) + case "openVideoCall": + self.startVideoCall(result: result, call: call) + case "showVideo": + self.showVideo() default: result(FlutterMethodNotImplemented) } @@ -69,6 +71,10 @@ extension MainAppViewController : ICallProtocol{ } } + private func showVideo(){ + videoCallContainer.isHidden = false + } + private func startVideoCall(result: @escaping FlutterResult, call:FlutterMethodCall) { videoCallFlutterResult = result @@ -78,6 +84,9 @@ extension MainAppViewController : ICallProtocol{ videoCallViewController.onMinimize = { min in self.minimizeVideoCall(min) } + videoCallViewController.onHide = { + self.videoCallContainer.isHidden = true + } videoCallViewController.onClose = videoCallClosed videoCallViewController.callBack = self videoCallViewController.start(params: VideoCallRequestParameters(dictionary: arguments)) diff --git a/ios/Runner/VideoCallViewController.swift b/ios/Runner/VideoCallViewController.swift index 69d65fb3..3e8b612c 100644 --- a/ios/Runner/VideoCallViewController.swift +++ b/ios/Runner/VideoCallViewController.swift @@ -35,23 +35,30 @@ class VideoCallViewController: UIViewController { var isUserConnect : Bool = false var onMinimize:((Bool)->Void)? = nil + var onHide:(()->Void)? = nil var onClose:(()->Void)? = nil + + @IBOutlet weak var lblRemoteUsername: UILabel! + // Bottom Actions - @IBOutlet weak var actionsHeightConstraint: NSLayoutConstraint! @IBOutlet weak var videoMuteBtn: UIButton! @IBOutlet weak var micMuteBtn: UIButton! - @IBOutlet weak var localvideoTopMargin: NSLayoutConstraint! + @IBOutlet var minimizeConstraint: [NSLayoutConstraint]! + @IBOutlet var maximisedConstraint: [NSLayoutConstraint]! + + @IBOutlet weak var hideVideoBtn: UIButton! + @IBOutlet weak var draggableBoundryDefiner: UIView! var localVideoDraggable:AADraggableView? @IBOutlet weak var controlButtons: UIView! @IBOutlet weak var remoteVideoMutedIndicator: UIImageView! @IBOutlet weak var localVideoMutedBg: UIView! + @IBOutlet weak var lblCallDuration: UILabel! @IBOutlet weak var remoteVideo: UIView! @IBOutlet weak var localVideo: UIView!{ didSet{ - localVideo.layer.borderColor = UIColor.white.cgColor localVideoDraggable = localVideo?.superview as? AADraggableView localVideoDraggable?.reposition = .edgesOnly } @@ -59,6 +66,7 @@ class VideoCallViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() + localVideoDraggable?.respectedView = draggableBoundryDefiner } @IBAction func didClickMuteButton(_ sender: UIButton) { @@ -107,12 +115,16 @@ class VideoCallViewController: UIViewController { minimized = !minimized onMinimize?(minimized) sender.isSelected = minimized + + NSLayoutConstraint.activate(minimized ? minimizeConstraint : maximisedConstraint) + NSLayoutConstraint.deactivate(minimized ? maximisedConstraint : minimizeConstraint) localVideoDraggable?.enable(!minimized) + lblRemoteUsername.isHidden = minimized + hideVideoBtn.isHidden = !minimized + let min_ = minimized UIView.animate(withDuration: 0.5) { - self.actionsHeightConstraint.constant = min_ ? 30 : 60 - self.localvideoTopMargin.constant = min_ ? 20 : 40 self.videoMuteBtn.isHidden = min_ self.micMuteBtn.isHidden = min_ @@ -125,6 +137,10 @@ class VideoCallViewController: UIViewController { } } + @IBAction func hideVideoBtnTapped(_ sender: Any) { + onHide?() + } + func start(params:VideoCallRequestParameters){ self.kApiKey = params.apiKey ?? "" @@ -352,6 +368,8 @@ extension VideoCallViewController: OTSessionDelegate { } publisher?.view!.frame = CGRect(x: 0, y: 0, width: localVideo.bounds.size.width, height: localVideo.bounds.size.height) + publisher?.view?.layer.cornerRadius = 5 + publisher?.view?.clipsToBounds = true localVideo.addSubview((publisher?.view)!) } From 3fefcf60d7d304274af6fbfdbe93b3bf9d4d593f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 13 Jun 2021 10:06:42 +0300 Subject: [PATCH 074/124] match the app header design --- lib/config/config.dart | 4 +- .../profile/patient-profile-app-bar.dart | 130 ++++++++---------- 2 files changed, 59 insertions(+), 75 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index eb946dea..4bbbd40e 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 750ee9d5..770137a2 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -9,7 +9,6 @@ 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'; import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -98,7 +97,7 @@ class PatientProfileAppBar extends StatelessWidget child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, + color: Color(0xFF2B353E), //Colors.black, onPressed: () => Navigator.pop(context), ), Expanded( @@ -111,6 +110,7 @@ class PatientProfileAppBar extends StatelessWidget fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', + color: Color(0xFF2B353E), ), ), gender == 1 @@ -215,10 +215,10 @@ class PatientProfileAppBar extends StatelessWidget AppText( TranslationBase.of(context).appointmentDate + " : ", - fontSize: 14, - fontWeight: FontWeight.normal, + fontSize: 10, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, fontFamily: 'Poppins', - color: Colors.black, ), patient.startTime != null ? Container( @@ -231,7 +231,7 @@ class PatientProfileAppBar extends StatelessWidget child: AppText( patient.startTime ?? "", color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 12, textAlign: TextAlign.center, fontWeight: FontWeight.bold, ), @@ -244,7 +244,7 @@ class PatientProfileAppBar extends StatelessWidget child: AppText( AppDateUtils.convertDateFormatImproved( patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 12, fontWeight: FontWeight.bold, ), ), @@ -267,17 +267,23 @@ class PatientProfileAppBar extends StatelessWidget color: Colors.black), children: [ new TextSpan( - text: TranslationBase - .of(context) - .fileNumber, - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), + text: TranslationBase + .of(context) + .fileNumber, + + style: TextStyle( + fontSize: 10, + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + + ),), new TextSpan( text: patient.patientId.toString(), style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 12, color: Color(0xFF2E303A),)), ], ), ), @@ -316,8 +322,10 @@ class PatientProfileAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age+ " : ", - style: TextStyle(fontSize: 14)), + text: TranslationBase + .of(context) + .age + " : ", + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), new TextSpan( text: "${AppDateUtils.getAgeByBirthday( @@ -327,7 +335,9 @@ class PatientProfileAppBar extends StatelessWidget : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 14)), + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A),)), ], ), ), @@ -361,9 +371,7 @@ class PatientProfileAppBar extends StatelessWidget child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), fontFamily: 'Poppins', ), children: [ @@ -373,21 +381,22 @@ class PatientProfileAppBar extends StatelessWidget : TranslationBase.of(context) .admissionDate + " : ", - style: TextStyle(fontSize: 14)), + style: TextStyle(fontSize: 10)), new TextSpan( text: patient.admissionDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A),)), ]))), if (patient.admissionDate != null) Row( children: [ AppText( "${TranslationBase.of(context).numOfDays}: ", - fontSize: 15, + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757) ), if(isDischargedPatient && patient.dischargeDate != null) @@ -399,8 +408,10 @@ class PatientProfileAppBar extends StatelessWidget .getDateTimeFromServerFormat( patient.admissionDate)) .inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700) + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + ) else AppText( "${DateTime @@ -409,8 +420,9 @@ class PatientProfileAppBar extends StatelessWidget .getDateTimeFromServerFormat( patient.admissionDate)) .inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700), + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A),), ], ), ], @@ -468,17 +480,17 @@ class PatientProfileAppBar extends StatelessWidget '${TranslationBase .of(context) .dr}$doctorName', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 9, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + fontSize: 12, ), if (orderNo != null && !isPrescriptions) Row( children: [ AppText('Order No: ', - color: Colors.grey[800], - fontSize: 12), + + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(orderNo ?? '', fontSize: 12) ], @@ -488,8 +500,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Invoice: ', - color: Colors.grey[800], - fontSize: 12), + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(invoiceNO ?? "", fontSize: 12) ], @@ -498,8 +509,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Branch: ', - color: Colors.grey[800], - fontSize: 12), + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(branch ?? '', fontSize: 12) ], @@ -509,8 +519,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Clinic: ', - color: Colors.grey[800], - fontSize: 12), + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(clinic ?? '', fontSize: 12) ], @@ -520,8 +529,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Episode: ', - color: Colors.grey[800], - fontSize: 12), + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(episode ?? '', fontSize: 12) ], @@ -531,23 +539,20 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Visit Date: ', - color: Colors.grey[800], - fontSize: 12), + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(visitDate ?? '', fontSize: 12) ], ), if (!isMedicalFile) Row( + children: [ - Expanded( - child: AppText( - !isPrescriptions - ? 'Result Date: ' - : 'Prescriptions Date ', - color: Colors.grey[800], - fontSize: 12, - ), + AppText( + !isPrescriptions + ? 'Result Date:' + : 'Prescriptions Date ', + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), ), AppText( '${AppDateUtils @@ -573,27 +578,6 @@ class PatientProfileAppBar extends StatelessWidget ), ); } - - - - - isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); - } - - myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); - } - @override Size get preferredSize => Size(double.maxFinite, height == 0 From bc53ca7b8aab8aa5d992b98ef2e79cfd781bc3cf Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 13 Jun 2021 13:07:39 +0300 Subject: [PATCH 075/124] fix appointment date in header --- .../patient_profile_screen.dart | 2 +- lib/util/date-utils.dart | 6 +- .../profile/patient-profile-app-bar.dart | 113 +++++++----------- 3 files changed, 48 insertions(+), 73 deletions(-) diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index cc71dd6d..e0bea0b7 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -108,7 +108,7 @@ class _PatientProfileScreenState extends State isFromLiveCare: isFromLiveCare, height: (patient.patientStatusType != null && patient.patientStatusType == 43) - ? 210 + ? 220 : isDischargedPatient ? 240 : 0, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 511b99e9..9b00ba2b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -16,7 +16,11 @@ class AppDateUtils { } static String convertStringToDateFormat(String date, String dateFormat) { - DateTime dateTime = DateTime.parse(date); + DateTime dateTime ; + if(date.contains("/Date")) + dateTime= getDateTimeFromServerFormat(date); + else + dateTime = DateTime.parse(date); return convertDateToFormat(dateTime, dateFormat); } diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 770137a2..5d676061 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -60,6 +60,7 @@ class PatientProfileAppBar extends StatelessWidget this.isFromSOAP = false, this.isFromLabResult = false}); + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -84,8 +85,8 @@ class PatientProfileAppBar extends StatelessWidget ? isInpatient ? 215 : isAppointmentHeader - ? 310 - : 200 + ? 325 + : 215 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), @@ -157,8 +158,7 @@ class PatientProfileAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + patient.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -182,81 +182,18 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' || patient.arrivedOn == null + patient.startTime != null ? AppText( patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, - ) - : AppText( - patient.arrivedOn != null - ? (isFromSOAP ? AppDateUtils - .getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - patient.arrivedOn)) : AppDateUtils - .convertStringToDateFormat( - patient.arrivedOn, - 'MM-dd-yyyy HH:mm')) - : '', - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + ):SizedBox() ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" && !isFromLiveCare) - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).appointmentDate + - " : ", - fontSize: 10, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - patient.startTime != null - ? Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), - ), - child: AppText( - patient.startTime ?? "", - color: Colors.white, - fontSize: 12, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - ) - : SizedBox(), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - AppDateUtils.convertDateFormatImproved( - patient.appointmentDate ?? ''), - fontSize: 12, - fontWeight: FontWeight.bold, - ), - ), - SizedBox( - height: 0.5, - ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), - ), + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -342,6 +279,40 @@ class PatientProfileAppBar extends StatelessWidget ), ), ), + + if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty) + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).appointmentDate + + " : ", + fontSize: 10, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + SizedBox( + width: 3.5, + ), + AppText( + (isFromSOAP ? AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + patient.appointmentDate)) : AppDateUtils + .convertStringToDateFormat( + patient.appointmentDate, + 'MM-dd-yyyy')) + , + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + ), + SizedBox( + height: 0.5, + ) + ], + ), if(isFromLabResult)Container( child: RichText( text: new TextSpan( @@ -581,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? 215 : isAppointmentHeader ? 310 : 200 + ? isInpatient ? 215 : isAppointmentHeader ? 325 : 215 : height); } From 1b4988e5f05a9da553ecce811844f7a351999b45 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Sun, 13 Jun 2021 14:45:46 +0300 Subject: [PATCH 076/124] no message --- .../xcshareddata/xcschemes/Runner.xcscheme | 8 ++- ios/Runner/Base.lproj/Main.storyboard | 70 ++++++++++++------- ios/Runner/MainAppViewController.swift | 9 ++- ios/Runner/VideoCallViewController.swift | 29 +++++++- .../patient_profile_screen.dart | 34 ++++++--- lib/util/VideoChannel.dart | 24 ++++++- ...ent-profile-header-new-design-app-bar.dart | 24 ++++++- 7 files changed, 153 insertions(+), 45 deletions(-) diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index fb2dffc4..a28140cf 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -27,6 +27,8 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + - - + + + + - + + + + + + - + + + @@ -200,6 +207,21 @@ + @@ -209,22 +231,11 @@ - - @@ -281,6 +294,7 @@ + @@ -288,18 +302,24 @@ - + - - - - - - - - + + + + + + + + + + + + + + diff --git a/ios/Runner/MainAppViewController.swift b/ios/Runner/MainAppViewController.swift index a6e4bcea..3849635e 100644 --- a/ios/Runner/MainAppViewController.swift +++ b/ios/Runner/MainAppViewController.swift @@ -27,9 +27,10 @@ class MainAppViewController: FlutterViewController{ super.viewDidAppear(animated) } + var videoCallChannel:FlutterMethodChannel? private func initFlutterBridge(){ - let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall", binaryMessenger: binaryMessenger) - videoCallChannel.setMethodCallHandler({ + videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall", binaryMessenger: binaryMessenger) + videoCallChannel?.setMethodCallHandler({ (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in switch call.method { case "openVideoCall": @@ -86,6 +87,10 @@ extension MainAppViewController : ICallProtocol{ } videoCallViewController.onHide = { self.videoCallContainer.isHidden = true + self.videoCallChannel?.invokeMethod("onHide", arguments: nil) + } + videoCallViewController.onVideoDuration = { duration in + self.videoCallChannel?.invokeMethod("onVideoDuration", arguments: duration) } videoCallViewController.onClose = videoCallClosed videoCallViewController.callBack = self diff --git a/ios/Runner/VideoCallViewController.swift b/ios/Runner/VideoCallViewController.swift index 3e8b612c..fd25541b 100644 --- a/ios/Runner/VideoCallViewController.swift +++ b/ios/Runner/VideoCallViewController.swift @@ -36,6 +36,7 @@ class VideoCallViewController: UIViewController { var onMinimize:((Bool)->Void)? = nil var onHide:(()->Void)? = nil + var onVideoDuration:((String)->Void)? = nil var onClose:(()->Void)? = nil @@ -44,6 +45,7 @@ class VideoCallViewController: UIViewController { // Bottom Actions @IBOutlet weak var videoMuteBtn: UIButton! @IBOutlet weak var micMuteBtn: UIButton! + @IBOutlet weak var camSwitchBtn: UIButton! @IBOutlet var minimizeConstraint: [NSLayoutConstraint]! @IBOutlet var maximisedConstraint: [NSLayoutConstraint]! @@ -109,6 +111,10 @@ class VideoCallViewController: UIViewController { callBack?.sessionDone(res:["callResponse":"CallEnd"]) sessionDisconnect() } + + @IBAction func hideVideoBtnTapped(_ sender: Any) { + onHide?() + } var minimized = false @IBAction func onMinimize(_ sender: UIButton) { @@ -122,11 +128,13 @@ class VideoCallViewController: UIViewController { lblRemoteUsername.isHidden = minimized hideVideoBtn.isHidden = !minimized + lblCallDuration.superview?.isHidden = !hideVideoBtn.isHidden let min_ = minimized UIView.animate(withDuration: 0.5) { self.videoMuteBtn.isHidden = min_ self.micMuteBtn.isHidden = min_ + self.camSwitchBtn.isHidden = min_ let localVdoSize = self.localVideo.bounds.size let remoteVdoSize = self.remoteVideo.bounds.size @@ -137,8 +145,20 @@ class VideoCallViewController: UIViewController { } } - @IBAction func hideVideoBtnTapped(_ sender: Any) { - onHide?() + var durationTimer:Timer?; + func startUpdateCallDuration(){ + var seconds = 0 + durationTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { timer in + seconds = seconds+1 + let durationSegments = (seconds / 3600, (seconds % 3600) / 60, (seconds % 3600) % 60) + let hours = String(format: "%02d", durationSegments.0) + let mins = String(format: "%02d", durationSegments.1) + let secs = String(format: "%02d", durationSegments.2) + let durationString = "\(mins):\(secs)" + + self.lblCallDuration.text = durationString + self.onVideoDuration?(durationString) + } } func start(params:VideoCallRequestParameters){ @@ -410,8 +430,11 @@ extension VideoCallViewController: OTSessionDelegate { guard let subscriberView = subscriber.view else { return } + subscriberView.frame = CGRect(x: 0, y: 0, width: remoteVideo.bounds.width, height: remoteVideo.bounds.height) remoteVideo.addSubview(subscriberView) + + startUpdateCallDuration() } func setupSubscribe(_ stream: OTStream?) { @@ -474,7 +497,7 @@ extension VideoCallViewController: OTSubscriberDelegate { print("The subscriber failed to connect to the stream.") } @objc func hideControlButtons() { - controlButtons.isHidden = true +// controlButtons.isHidden = true } } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 30f53a0b..f2a52411 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; @@ -46,10 +48,15 @@ class _PatientProfileScreenState extends State TabController _tabController; int index = 0; int _activeTab = 0; + + StreamController videoCallDurationStreamController; + Stream videoCallDurationStream = (() async*{})(); @override void initState() { _tabController = TabController(length: 2, vsync: this); super.initState(); + videoCallDurationStreamController = StreamController(); + videoCallDurationStream = videoCallDurationStreamController.stream; } @override @@ -103,16 +110,20 @@ class _PatientProfileScreenState extends State Column( children: [ PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType, - isInpatient: isInpatient, - isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient: isDischargedPatient), + patient, arrivalType ?? '0', patientType, + videoCallDurationStream: videoCallDurationStream, + onVideoDurationTap: (){ + VideoChannel.show(); + }, + isInpatient: isInpatient, + isFromLiveCare: isFromLiveCare, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), Container( height: !isSearchAndOut ? isDischargedPatient @@ -311,6 +322,9 @@ class _PatientProfileScreenState extends State onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, + onVideoDuration: (duration){ + videoCallDurationStreamController.sink.add(duration); + }, onCallEnd: () { var asd=""; // WidgetsBinding.instance.addPostFrameCallback((_) { diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index a0962010..a9c2b5e2 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -4,15 +4,30 @@ import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class VideoChannel{ /// channel name static const _channel = const MethodChannel("Dr.cloudSolution/videoCall"); - static openVideoCallScreen( - {kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID,String generalId,int doctorId, Function() onCallEnd , Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure}) async { + static openVideoCallScreen({kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID, + String generalId,int doctorId, Function() onCallEnd , + Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onHide, Function(String) onVideoDuration}) async { + + onHide = onHide ?? (){}; + onVideoDuration = onVideoDuration ?? (v){}; + var result; try { + _channel.setMethodCallHandler((call) { + if(call.method == 'onHide'){ + onHide(); + }else if(call.method == 'onVideoDuration'){ + onVideoDuration(call.arguments); + } + return true as dynamic; + }); + result = await _channel.invokeMethod( 'openVideoCall', { @@ -29,6 +44,7 @@ class VideoChannel{ ); if(result['callResponse'] == 'CallEnd') { onCallEnd(); + onVideoDuration(null); } else { SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); @@ -40,6 +56,10 @@ class VideoChannel{ } } + + static show(){ + _channel.invokeMethod("showVideo"); + } } \ No newline at end of file diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 995ac57a..69bb9758 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -21,8 +21,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; + final Stream videoCallDurationStream; + final VoidCallback onVideoDurationTap; + PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false, this.videoCallDurationStream, this.onVideoDurationTap}); @override Widget build(BuildContext context) { @@ -88,6 +91,25 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), ), ), + StreamBuilder( + stream: videoCallDurationStream, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if(snapshot.hasData) + return InkWell( + onTap: (){ + if(onVideoDurationTap != null) + onVideoDurationTap(); + }, + child: Container( + decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), + child: Text(snapshot.data, style: TextStyle(color: Colors.white),), + ), + ); + else + return Container(); + }, + ), ]), ), Row(children: [ From 411746da984b7d83592a578421260170b5dff3b0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 13 Jun 2021 15:00:54 +0300 Subject: [PATCH 077/124] remove patient type and arrival type form patient profile header --- lib/screens/live_care/end_call_screen.dart | 2 +- .../medical-file/health_summary_page.dart | 2 - .../medical-file/medical_file_details.dart | 2 - lib/screens/patients/ECGPage.dart | 2 +- .../insurance_approval_screen_patient.dart | 2 - .../patients/insurance_approvals_details.dart | 2 +- .../profile/UCAF/UCAF-detail-screen.dart | 2 +- .../profile/UCAF/UCAF-input-screen.dart | 2 +- .../admission-request-first-screen.dart | 2 +- .../admission-request-third-screen.dart | 2 +- .../admission-request_second-screen.dart | 2 +- .../lab_result/laboratory_result_page.dart | 3 +- .../profile/lab_result/labs_home_page.dart | 3 +- .../MedicalReportDetailPage.dart | 2 - .../medical_report/MedicalReportPage.dart | 2 - .../profile/note/progress_note_screen.dart | 2 - .../patient_profile_screen.dart | 3 +- .../radiology/radiology_details_page.dart | 2 - .../radiology/radiology_home_page.dart | 2 - .../refer-patient-screen-in-patient.dart | 2 - .../referral/refer-patient-screen.dart | 2 +- .../soap_update/update_soap_index.dart | 2 +- .../vital_sign/vital_sign_details_screen.dart | 2 +- .../vital_sign_item_details_screen.dart | 2 +- .../prescription_item_in_patient_page.dart | 2 +- .../prescription/prescription_items_page.dart | 2 - .../prescription/prescriptions_page.dart | 2 - lib/screens/procedures/procedure_screen.dart | 2 - lib/screens/sick-leave/add-sickleave.dart | 2 - lib/screens/sick-leave/show-sickleave.dart | 2 - .../profile/patient-profile-app-bar.dart | 61 +++++++++---------- 31 files changed, 44 insertions(+), 80 deletions(-) diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 411079fc..754ccb47 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -185,7 +185,7 @@ class _EndCallScreenState extends State { backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, appBar: PatientProfileAppBar( - widget.patient, arrivalType ?? '7', '1', + widget.patient, isInpatient: isInpatient, height: (widget.patient.patientStatusType != null && widget.patient.patientStatusType == 43) diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index ee4726e2..6b4b066c 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -32,8 +32,6 @@ class _HealthSummaryPageState extends State { AppScaffold( appBar: PatientProfileAppBar( patient, - patientType.toString() ?? "0", - arrivalType, isInpatient: isInpatient, ), isShowAppBar: true, diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 64d76f06..b53284a9 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -104,8 +104,6 @@ class _MedicalFileDetailsState extends State { AppScaffold( appBar: PatientProfileAppBar( patient, - patient.patientType.toString() ?? "0", - patient.arrivedOn.toString() ?? 0, doctorName: doctorName, profileUrl: doctorImage, clinic: clinicName, diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 97923959..ba4c108c 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -31,7 +31,7 @@ class ECGPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Color(0xffF8F8F8), - appBar: PatientProfileAppBar(patient,arrivalType??'0',patientType), + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 3d03589b..1ab0734b 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -46,8 +46,6 @@ class _InsuranceApprovalScreenNewState AppScaffold( appBar: PatientProfileAppBar( patient, - patientType.toString() ?? "0", - patientType, isInpatient: isInpatient, ), isShowAppBar: true, diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 57af55d8..0945df37 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -55,7 +55,7 @@ class _InsuranceApprovalsDetailsState extends State { isShowAppBar: true, baseViewModel: model, appBar: PatientProfileAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), + patient), body: patient.admissionNo != null ? SingleChildScrollView( child: Container( diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index af61de0d..081f1a6e 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -48,7 +48,7 @@ class _UcafDetailScreenState extends State { baseViewModel: model, isShowAppBar: true, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient), appBarTitle: TranslationBase.of(context).ucaf, body: Column( children: [ diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 7c163a79..3bbc6637 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -66,7 +66,7 @@ class _UCAFInputScreenState extends State { baseViewModel: model, isShowAppBar: true, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient), appBarTitle: TranslationBase.of(context).ucaf, body: model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index dd6d9d76..f0ccaece 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -62,7 +62,7 @@ class _AdmissionRequestThirdScreenState baseViewModel: model, isShowAppBar: true, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 175f5669..563b4827 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -53,7 +53,7 @@ class _AdmissionRequestThirdScreenState baseViewModel: model, isShowAppBar: true, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index f7e03533..dc79b2be 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -75,7 +75,7 @@ class _AdmissionRequestSecondScreenState baseViewModel: model, isShowAppBar: true, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { 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 23b17830..d6b4d2bc 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -40,8 +40,7 @@ class _LaboratoryResultPageState extends State { isShowAppBar: true, appBar: PatientProfileAppBar( widget.patient, - widget.patientType ?? "0", - widget.arrivalType ?? "0", + 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 96b64675..b2bfa2fd 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -54,8 +54,7 @@ class _LabsHomePageState extends State { isShowAppBar: true, appBar: PatientProfileAppBar( patient, - patient.patientType.toString() ?? '0', - patientType, + isInpatient: isInpatient, ), body: SingleChildScrollView( diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index 7b787f44..ab24f8e0 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -33,8 +33,6 @@ class MedicalReportDetailPage extends StatelessWidget { backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: PatientProfileAppBar( patient, - patientType, - arrivalType, ), body: Container( child: SingleChildScrollView( diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 5f6b3eea..aa9d0b58 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -45,8 +45,6 @@ class MedicalReportPage extends StatelessWidget { backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: PatientProfileAppBar( patient, - patientType, - arrivalType, ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 087cab80..723ee75f 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -90,8 +90,6 @@ class _ProgressNoteState extends State { // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileAppBar( patient, - patient.patientType.toString() ?? '0', - arrivalType, isInpatient: true, ), body: model.patientProgressNoteList == null || diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index e0bea0b7..8a831c4d 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -103,8 +103,7 @@ class _PatientProfileScreenState extends State Column( children: [ PatientProfileAppBar( - patient, arrivalType ?? '0', patientType, - isInpatient: isInpatient, + patient, isFromLiveCare: isFromLiveCare, height: (patient.patientStatusType != null && patient.patientStatusType == 43) diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index cb0cd99a..48bef68a 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -37,8 +37,6 @@ class RadiologyDetailsPage extends StatelessWidget { builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( patient, - patientType ?? "0", - arrivalType ?? "0", appointmentDate: finalRadiology.orderDate, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 8d0946c5..3d8d527c 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -52,8 +52,6 @@ class _RadiologyHomePageState extends State { // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileAppBar( patient, - patient.patientType.toString() ?? '0', - arrivalType, isInpatient: isInpatient, ), baseViewModel: model, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 11ace2f6..66fd22fd 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -138,8 +138,6 @@ class _PatientMakeInPatientReferralScreenState extends State { appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index ab5e02d0..60597b11 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -82,7 +82,7 @@ class _UpdateSoapIndexState extends State mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileAppBar(patient, '7', '7',isFromSOAP: true,), + PatientProfileAppBar(patient), Container( width: double.infinity, height: 1, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index a67e213f..23266095 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -41,7 +41,7 @@ class VitalSignDetailsScreen extends StatelessWidget { isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient), appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 0c41386c..0ed9da56 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -191,7 +191,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, appBar: PatientProfileAppBar( - patient, patientType, arrivalType), + patient,), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index 472f6dd8..7cf33935 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -45,7 +45,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), + patient), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index e888dddd..b97343c4 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -30,8 +30,6 @@ class PrescriptionItemsPage extends StatelessWidget { baseViewModel: model, appBar: PatientProfileAppBar( patient, - patientType??"0", - arrivalType??"0", clinic: prescriptions.clinicDescription, branch: prescriptions.name, isPrescriptions: true, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 17b36233..1a99299b 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -37,8 +37,6 @@ class PrescriptionsPage extends StatelessWidget { backgroundColor: Colors.grey[100], appBar: PatientProfileAppBar( patient, - patientType ?? '0', - arrivalType, isInpatient: isInpatient, ), body: patient.admissionNo == null diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index aa51fc18..79371459 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -46,8 +46,6 @@ class ProcedureScreen extends StatelessWidget { baseViewModel: model, appBar: PatientProfileAppBar( patient, - arrivalType ?? '0', - patientType, isInpatient: isInpatient, ), body: SingleChildScrollView( diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index d7759f9e..7b065321 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -36,8 +36,6 @@ class AddSickLeavScreen extends StatelessWidget { backgroundColor: Colors.grey[100], appBar: PatientProfileAppBar( patient, - routeArgs['patientType'] ?? "0", - routeArgs['arrivalType'] ?? "0", isInpatient: isInpatient, ), body: SingleChildScrollView( diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 4ead8cd3..726524d8 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -27,8 +27,6 @@ class ShowSickLeaveScreen extends StatelessWidget { backgroundColor: Colors.grey[100], appBar: PatientProfileAppBar( patient, - routeArgs['patientType'] ?? "0", - routeArgs['arrivalType'] ?? "0", ), body: SingleChildScrollView( child: Column( diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 5d676061..467d681b 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.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/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -8,7 +7,6 @@ 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'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -17,8 +15,6 @@ import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; - final String patientType; - final String arrivalType; final double height; final bool isInpatient; final bool isDischargedPatient; @@ -36,11 +32,10 @@ class PatientProfileAppBar extends StatelessWidget final String visitDate; final String clinic; final bool isAppointmentHeader; - final bool isFromSOAP; final bool isFromLabResult; PatientProfileAppBar( - this.patient, this.patientType, this.arrivalType, + this.patient, {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, @@ -57,7 +52,6 @@ class PatientProfileAppBar extends StatelessWidget this.episode, this.visitDate, this.isAppointmentHeader = false, - this.isFromSOAP = false, this.isFromLabResult = false}); @@ -86,7 +80,7 @@ class PatientProfileAppBar extends StatelessWidget ? 215 : isAppointmentHeader ? 325 - : 215 + : 200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), @@ -173,25 +167,24 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ) - : AppText( - TranslationBase - .of(context) - .notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), - patient.startTime != null - ? AppText( + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), patient.startTime != null - ? patient.startTime - : '', - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ):SizedBox() - ], - )) + ? AppText( + patient.startTime != null + ? patient.startTime + : '', + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A)) + : SizedBox() + ], + )) : SizedBox(), Row( @@ -296,13 +289,10 @@ class PatientProfileAppBar extends StatelessWidget width: 3.5, ), AppText( - (isFromSOAP ? AppDateUtils + AppDateUtils .getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( - patient.appointmentDate)) : AppDateUtils - .convertStringToDateFormat( - patient.appointmentDate, - 'MM-dd-yyyy')) + patient.appointmentDate)) , fontWeight: FontWeight.w700, fontSize: 12, @@ -356,7 +346,12 @@ class PatientProfileAppBar extends StatelessWidget new TextSpan( text: patient.admissionDate == null ? "" - : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + : "${AppDateUtils + .getDayMonthYearDateFormatted( + (AppDateUtils + .getDateTimeFromServerFormat( + patient.admissionDate + .toString())))}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12, @@ -552,6 +547,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? 215 : isAppointmentHeader ? 325 : 215 + ? isInpatient ? 215 : isAppointmentHeader ? 325 : 200 : height); } From 142fbb93fd533379857803f1e560cb6280c4f386 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 13 Jun 2021 15:09:27 +0300 Subject: [PATCH 078/124] Referrel Doctor reply --- dart | 0 lib/config/config.dart | 1 + .../referral/MyReferralPatientModel.dart | 6 +- .../add_referred_remarks_request.dart | 72 +++++++ .../patient/MyReferralPatientService.dart | 71 ++++--- .../viewModel/patient-referral-viewmodel.dart | 103 +++++---- .../referral/AddReplayOnReferralPatient.dart | 86 +++++--- .../my-referral-inpatient-screen.dart | 20 +- .../referral_patient_detail_in-paint.dart | 201 ++++++------------ lib/screens/qr_reader/QR_reader_screen.dart | 28 +-- pubspec.lock | 6 +- 11 files changed, 311 insertions(+), 283 deletions(-) create mode 100644 dart create mode 100644 lib/core/model/referral/add_referred_remarks_request.dart diff --git a/dart b/dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/config/config.dart b/lib/config/config.dart index eb946dea..492d7ada 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -224,6 +224,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 ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; var selectedPatientType = 1; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 1072e098..ce8a6447 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -61,6 +61,7 @@ class MyReferralPatientModel { String priorityDescription; String referringClinicDescription; String referringDoctorName; + int referalStatus; MyReferralPatientModel( {this.rowID, @@ -122,10 +123,12 @@ class MyReferralPatientModel { this.nursingStationName, this.priorityDescription, this.referringClinicDescription, - this.referringDoctorName}); + this.referringDoctorName, + this.referalStatus}); MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; + referalStatus = json['ReferalStatus']; projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; doctorID = json['DoctorID']; @@ -203,6 +206,7 @@ class MyReferralPatientModel { Map toJson() { final Map data = new Map(); data['RowID'] = this.rowID; + data['ReferalStatus'] = this.referalStatus; data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; data['DoctorID'] = this.doctorID; diff --git a/lib/core/model/referral/add_referred_remarks_request.dart b/lib/core/model/referral/add_referred_remarks_request.dart new file mode 100644 index 00000000..14089513 --- /dev/null +++ b/lib/core/model/referral/add_referred_remarks_request.dart @@ -0,0 +1,72 @@ +class AddReferredRemarksRequestModel { + int projectID; + int admissionNo; + int lineItemNo; + String referredDoctorRemarks; + int editedBy; + int referalStatus; + bool isLoginForDoctorApp; + String iPAdress; + bool patientOutSA; + String tokenID; + int languageID; + double versionID; + int channel; + String sessionID; + int deviceTypeID; + + AddReferredRemarksRequestModel( + {this.projectID, + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.referalStatus, + this.isLoginForDoctorApp, + this.iPAdress, + this.patientOutSA, + this.tokenID, + this.languageID, + this.versionID, + this.channel, + this.sessionID, + this.deviceTypeID}); + + AddReferredRemarksRequestModel.fromJson(Map json) { + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + lineItemNo = json['LineItemNo']; + referredDoctorRemarks = json['ReferredDoctorRemarks']; + editedBy = json['EditedBy']; + referalStatus = json['ReferalStatus']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + iPAdress = json['IPAdress']; + patientOutSA = json['PatientOutSA']; + tokenID = json['TokenID']; + languageID = json['LanguageID']; + versionID = json['VersionID']; + channel = json['Channel']; + sessionID = json['SessionID']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['LineItemNo'] = this.lineItemNo; + data['ReferredDoctorRemarks'] = this.referredDoctorRemarks; + data['EditedBy'] = this.editedBy; + data['ReferalStatus'] = this.referalStatus; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['IPAdress'] = this.iPAdress; + data['PatientOutSA'] = this.patientOutSA; + data['TokenID'] = this.tokenID; + data['LanguageID'] = this.languageID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['SessionID'] = this.sessionID; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 39a75e8f..87fcdd23 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; @@ -11,20 +12,19 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); - MyReferralPatientRequestModel myReferralPatientRequestModel = - MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, - firstName: "0", - middleName: "0", - lastName: "0", - patientMobileNumber: "0", - patientIdentificationID: "0", - patientID: 0, - from: "0", - to: "0", - stamp: DateTime.now().toIso8601String(), - isLoginForDoctorApp: true, - patientTypeID: 1); + MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( + doctorID: doctorProfile.doctorID, + firstName: "0", + middleName: "0", + lastName: "0", + patientMobileNumber: "0", + patientIdentificationID: "0", + patientID: 0, + from: "0", + to: "0", + stamp: DateTime.now().toIso8601String(), + isLoginForDoctorApp: true, + patientTypeID: 1); myReferralPatients.clear(); await baseAppClient.post( GET_MY_REFERRAL_INPATIENT, @@ -47,8 +47,7 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); - MyReferralPatientRequestModel myReferralPatientRequestModel = - MyReferralPatientRequestModel( + MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( doctorID: doctorProfile.doctorID, firstName: "0", middleName: "0", @@ -79,18 +78,14 @@ class MyReferralInPatientService extends BaseService { ); } - Future replay( - String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { hasError = false; await getDoctorProfile(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = - RequestAddReferredDoctorRemarks(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); _requestAddReferredDoctorRemarks.projectID = referral.projectID; - _requestAddReferredDoctorRemarks.admissionNo = - referral.admissionNo.toString(); + _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = - referredDoctorRemarks; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; _requestAddReferredDoctorRemarks.patientID = referral.patientID; _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; @@ -104,4 +99,32 @@ class MyReferralInPatientService extends BaseService { }, ); } + + Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async { + hasError = false; + await getDoctorProfile(); + AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( + editedBy: doctorProfile.doctorID, + projectID: doctorProfile.projectID, + referredDoctorRemarks: referredDoctorRemarks, + referalStatus: referalStatus); + _requestAddReferredDoctorRemarks.projectID = referral.projectID; + _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.referalStatus = referalStatus; + + // _requestAddReferredDoctorRemarks.patientID = referral.patientID; + // _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; + await baseAppClient.post( + ADD_REFERRED_REMARKS_NEW, + body: _requestAddReferredDoctorRemarks.toJson(), + onSuccess: (dynamic body, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 01d40e62..9e852978 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart'; import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; @@ -18,16 +19,13 @@ import 'package:flutter/cupertino.dart'; import '../../locator.dart'; class PatientReferralViewModel extends BaseViewModel { - PatientReferralService _referralPatientService = - locator(); + PatientReferralService _referralPatientService = locator(); ReferralService _referralService = locator(); - MyReferralInPatientService _myReferralService = - locator(); + MyReferralInPatientService _myReferralService = locator(); - DischargedPatientService _dischargedPatientService = - locator(); + DischargedPatientService _dischargedPatientService = locator(); List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; @@ -36,28 +34,21 @@ class PatientReferralViewModel extends BaseViewModel { List get clinicsList => _referralPatientService.clinicsList; - List get referralFrequencyList => - _referralPatientService.frequencyList; + List get referralFrequencyList => _referralPatientService.frequencyList; List doctorsList = []; - List get clinicDoctorsList => - _referralPatientService.doctorsList; + List get clinicDoctorsList => _referralPatientService.doctorsList; - List get myReferralPatients => - _myReferralService.myReferralPatients; + List get myReferralPatients => _myReferralService.myReferralPatients; - List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; + List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; - List get pendingReferral => - _referralPatientService.pendingReferralList; + List get pendingReferral => _referralPatientService.pendingReferralList; - List get patientReferral => - _referralPatientService.patientReferralList; + List get patientReferral => _referralPatientService.patientReferralList; - List get patientArrivalList => - _referralPatientService.patientArrivalList; + List get patientArrivalList => _referralPatientService.patientArrivalList; Future getPatientReferral(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -106,8 +97,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getClinicDoctors( - PatiantInformtion patient, int clinicId, int branchId) async { + Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { @@ -125,10 +115,7 @@ class PatientReferralViewModel extends BaseViewModel { Future getDoctorBranch() async { DoctorProfileModel doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { - dynamic _selectedBranch = { - "facilityId": doctorProfile.projectID, - "facilityName": doctorProfile.projectName - }; + dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName}; return _selectedBranch; } return null; @@ -175,27 +162,38 @@ class PatientReferralViewModel extends BaseViewModel { } Future getMyReferralPatientService({bool localBusy = false}) async { - if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); + if (localBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); await _myReferralService.getMyReferralPatientService(); if (_myReferralService.hasError) { error = _myReferralService.error; - if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error); + if (localBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); } else setState(ViewState.Idle); } Future getMyReferralOutPatientService({bool localBusy = false}) async { - if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); + if (localBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); await _myReferralService.getMyReferralOutPatientService(); if (_myReferralService.hasError) { error = _myReferralService.error; - if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error); + if (localBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future replay( - String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { @@ -205,8 +203,7 @@ class PatientReferralViewModel extends BaseViewModel { getMyReferralPatientService(); } - Future responseReferral( - PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { setState(ViewState.Busy); await _referralPatientService.responseReferral(pendingReferral, isAccepted); if (_referralPatientService.hasError) { @@ -216,11 +213,10 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future makeReferral(PatiantInformtion patient, String isoStringDate, - int projectID, int clinicID, int doctorID, String remarks) async { + Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, + String remarks) async { setState(ViewState.Busy); - await _referralPatientService.makeReferral( - patient, isoStringDate, projectID, clinicID, doctorID, remarks); + await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.Error); @@ -260,12 +256,10 @@ class PatientReferralViewModel extends BaseViewModel { } } - Future getPatientDetails( - String fromDate, String toDate, int patientMrn, int appointmentNo) async { + Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { setState(ViewState.Busy); - await _referralPatientService.getPatientArrivalList(toDate, - fromDate: fromDate, patientMrn: patientMrn); + await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.Error); @@ -284,8 +278,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future verifyReferralDoctorRemarks( - MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { @@ -324,8 +317,7 @@ class PatientReferralViewModel extends BaseViewModel { } } - PatiantInformtion getPatientFromReferral( - MyReferredPatientModel referredPatient) { + PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -350,8 +342,7 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromReferralO( - MyReferralPatientModel referredPatient) { + PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -376,8 +367,7 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromDischargeReferralPatient( - DischargeReferralPatient referredPatient) { + PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -396,10 +386,19 @@ class PatientReferralViewModel extends BaseViewModel { patient.roomId = referredPatient.roomID; patient.bedId = referredPatient.bedID; patient.nationalityName = referredPatient.nationalityName; - patient.nationalityFlagURL = - ''; // TODO from backend referredPatient.nationalityFlagURL; + patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; patient.clinicDescription = referredPatient.clinicDescription; return patient; } + + Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async { + setState(ViewState.Busy); + await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus); + if (_myReferralService.hasError) { + error = _myReferralService.error; + setState(ViewState.ErrorLocal); + } else + getMyReferralPatientService(); + } } diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index c246a3ad..56ff85c4 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -1,7 +1,7 @@ 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/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; @@ -25,23 +24,25 @@ import 'ReplySummeryOnReferralPatient.dart'; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; + final AddReferredRemarksRequestModel myReferralInPatientRequestModel; final bool isEdited; const AddReplayOnReferralPatient( {Key key, this.patientReferralViewModel, this.myReferralInPatientModel, - this.isEdited}) + this.isEdited, + this.myReferralInPatientRequestModel}) : super(key: key); @override - _AddReplayOnReferralPatientState createState() => - _AddReplayOnReferralPatientState(); + _AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState - extends State { +class _AddReplayOnReferralPatientState extends State { bool isSubmitted = false; + int replay = 1; + int reject = 2; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); @@ -51,8 +52,7 @@ class _AddReplayOnReferralPatientState void initState() { requestPermissions(); super.initState(); - replayOnReferralController.text = - widget.myReferralInPatientModel.referredDoctorRemarks ?? ""; + replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks ?? ""; } @override @@ -84,9 +84,7 @@ class _AddReplayOnReferralPatientState maxLines: 35, minLines: 25, hasBorder: true, - validationError: replayOnReferralController - .text.isEmpty && - isSubmitted + validationError: replayOnReferralController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, ), @@ -139,8 +137,33 @@ class _AddReplayOnReferralPatientState children: [ Expanded( child: AppButton( - onPressed: () { - Navigator.of(context).pop(); + onPressed: () async { + if (replayOnReferralController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientReferralViewModel.replayReferred( + replayOnReferralController.text.trim(), widget.myReferralInPatientModel, reject); + if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientReferralViewModel.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast("Has been rejected"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + + // Navigator.push( + // context, + // FadePage( + // page: ReplySummeryOnReferralPatient( + // widget.myReferralInPatientModel, replayOnReferralController.text.trim()), + // ), + // ); + } + } else { + Helpers.showErrorToast("You can't add empty reply"); + setState(() { + isSubmitted = false; + }); + } }, title: TranslationBase.of(context).reject, fontColor: Colors.white, @@ -158,32 +181,26 @@ class _AddReplayOnReferralPatientState }); if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay( - replayOnReferralController.text.trim(), - widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.patientReferralViewModel.error); + await widget.patientReferralViewModel.replayReferred( + replayOnReferralController.text.trim(), widget.myReferralInPatientModel, replay); + if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientReferralViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Reply Added Successfully"); + DrAppToastMsg.showSuccesToast("Your Reply Added Successfully"); Navigator.of(context).pop(); Navigator.of(context).pop(); - Navigator.push( - context, - FadePage( - page: ReplySummeryOnReferralPatient( - widget.myReferralInPatientModel, - replayOnReferralController.text.trim()), - ), - ); + // Navigator.push( + // context, + // FadePage( + // page: ReplySummeryOnReferralPatient( + // widget.myReferralInPatientModel, replayOnReferralController.text.trim()), + // ), + // ); } } else { - Helpers.showErrorToast( - "You can't add empty reply"); + Helpers.showErrorToast("You can't add empty reply"); setState(() { isSubmitted = false; }); @@ -250,8 +267,7 @@ class _AddReplayOnReferralPatientState onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index f4a002d6..3ebd7896 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -16,7 +16,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyReferralInPatientScreen extends StatelessWidget { PatientType patientType = PatientType.IN_PATIENT; - @override Widget build(BuildContext context) { return BaseView( @@ -30,7 +29,7 @@ class MyReferralInPatientScreen extends StatelessWidget { Container( margin: EdgeInsets.only(top: 70), child: PatientTypeRadioWidget( - (patientType) async { + (patientType) async { this.patientType = patientType; GifLoaderDialogUtils.showMyDialog(context); if (patientType == PatientType.IN_PATIENT) { @@ -62,7 +61,7 @@ class MyReferralInPatientScreen extends StatelessWidget { ), ) : Expanded( - child: SingleChildScrollView( + child: SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -74,30 +73,31 @@ class MyReferralInPatientScreen extends StatelessWidget { Navigator.push( context, FadePage( - page: ReferralPatientDetailScreen(model.myReferralPatients[index],model), + page: ReferralPatientDetailScreen(model.myReferralPatients[index], model), ), ); }, child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context), + referralStatus: model.getReferralStatusNameByCode( + model.myReferralPatients[index].referralStatus, context), referralStatusCode: model.myReferralPatients[index].referralStatus, patientName: model.myReferralPatients[index].patientName, patientGender: model.myReferralPatients[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), + referredDate: AppDateUtils.getDayMonthYearDateFormatted( + model.myReferralPatients[index].referralDate), referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), patientID: "${model.myReferralPatients[index].patientID}", isSameBranch: false, isReferral: true, isReferralClinic: true, - referralClinic:"${model.myReferralPatients[index].referringClinicDescription}", + referralClinic: "${model.myReferralPatients[index].referringClinicDescription}", remark: model.myReferralPatients[index].referringDoctorRemarks, nationality: model.myReferralPatients[index].nationalityName, nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, doctorAvatar: model.myReferralPatients[index].doctorImageURL, referralDoctorName: model.myReferralPatients[index].referringDoctorName, clinicDescription: model.myReferralPatients[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), + infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), ), ), @@ -105,7 +105,7 @@ class MyReferralInPatientScreen extends StatelessWidget { ), ), ), - ), + ), ], ), ), diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 7f0cd146..66e01364 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -20,8 +20,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; - ReferralPatientDetailScreen( - this.referredPatient, this.patientReferralViewModel); + ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); @override Widget build(BuildContext context) { @@ -52,8 +51,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize( - "${referredPatient.firstName} ${referredPatient.lastName}")), + (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -70,18 +68,14 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = model - .getPatientFromReferralO(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferralO(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -98,18 +92,14 @@ class ReferralPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = model - .getPatientFromReferralO(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferralO(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Padding( @@ -144,8 +134,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", @@ -170,28 +159,23 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${referredPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -208,35 +192,29 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -244,31 +222,22 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), if (referredPatient.frequency != null) Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .frequencyDescription ?? - '', + referredPatient.frequencyDescription ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig - .textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -280,29 +249,22 @@ class ReferralPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != - null + referredPatient.nationalityName != null ? referredPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: - 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - referredPatient.nationalityFlagURL != - null + referredPatient.nationalityFlagURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient - .nationalityFlagURL, + referredPatient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext - context, - Object exception, - StackTrace stackTrace) { + errorBuilder: + (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -314,26 +276,21 @@ class ReferralPatientDetailScreen extends StatelessWidget { if (referredPatient.priorityDescription != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.priorityDescription ?? - '', + referredPatient.priorityDescription ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -342,33 +299,24 @@ class ReferralPatientDetailScreen extends StatelessWidget { if (referredPatient.mAXResponseTime != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.mAXResponseTime != - null - ? AppDateUtils - .convertDateFromServerFormat( - referredPatient - .mAXResponseTime, - "dd MMM,yyyy") + referredPatient.mAXResponseTime != null + ? AppDateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime, "dd MMM,yyyy") : '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -378,8 +326,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_up.png', height: 50, @@ -387,26 +334,17 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), - child: referredPatient.doctorImageURL != - null + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( referredPatient.doctorImageURL, height: 25, width: 30, errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -422,30 +360,22 @@ class ReferralPatientDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 30, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -469,10 +399,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { children: [ Container( width: double.infinity, - margin: - EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: - EdgeInsets.symmetric(horizontal: 16, vertical: 16), + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, @@ -508,10 +436,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { if (referredPatient.referredDoctorRemarks.isNotEmpty) Container( width: double.infinity, - margin: - EdgeInsets.symmetric(horizontal: 16, vertical: 0), - padding: EdgeInsets.symmetric( - horizontal: 16, vertical: 16), + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, @@ -566,8 +492,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { widget: AddReplayOnReferralPatient( patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, - isEdited: referredPatient - .referredDoctorRemarks.isNotEmpty, + isEdited: referredPatient.referredDoctorRemarks.isNotEmpty, ), ), ); diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 30c05fef..a411aaa7 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -61,8 +61,7 @@ class _QrReaderScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: - TranslationBase.of(context).qr + TranslationBase.of(context).reader, + appBarTitle: TranslationBase.of(context).qr + TranslationBase.of(context).reader, body: Center( child: Container( margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), @@ -80,9 +79,7 @@ class _QrReaderScreenState extends State { height: 7, ), AppText(TranslationBase.of(context).scanQrCode, - fontSize: 14, - fontWeight: FontWeight.w400, - textAlign: TextAlign.center), + fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center), SizedBox( height: 15, ), @@ -106,18 +103,13 @@ class _QrReaderScreenState extends State { margin: EdgeInsets.only(top: 8), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), - color: - Theme.of(context).errorColor.withOpacity(0.06), + color: Theme.of(context).errorColor.withOpacity(0.06), ), - padding: EdgeInsets.symmetric( - vertical: 8.0, horizontal: 12.0), + padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0), child: Row( children: [ Expanded( - child: AppText( - error ?? - TranslationBase.of(context) - .errorMessage, + child: AppText(error ?? TranslationBase.of(context).errorMessage, color: Theme.of(context).errorColor)), ], ), @@ -162,9 +154,7 @@ class _QrReaderScreenState extends State { case "0": if (response['List_MyOutPatient'] != null) { setState(() { - patientList = - ModelResponse.fromJson(response['List_MyOutPatient']) - .list; + patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list; isLoading = false; }); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { @@ -181,8 +171,7 @@ class _QrReaderScreenState extends State { case "1": if (response['List_MyInPatient'] != null) { setState(() { - patientList = - ModelResponse.fromJson(response['List_MyInPatient']).list; + patientList = ModelResponse.fromJson(response['List_MyInPatient']).list; isLoading = false; error = ""; }); @@ -203,8 +192,7 @@ class _QrReaderScreenState extends State { isLoading = false; isError = true; }); - DrAppToastMsg.showErrorToast( - response['ErrorEndUserMessage'] ?? response['ErrorMessage']); + DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']); } }).catchError((error) { setState(() { diff --git a/pubspec.lock b/pubspec.lock index 77df9848..25596d43 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.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -921,7 +921,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" 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" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From 161cb1e872b2416d7cf94a915f13940d0930b200 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 13 Jun 2021 15:51:44 +0300 Subject: [PATCH 079/124] fix profile height size --- lib/config/config.dart | 4 ++-- .../patient_profile_screen.dart | 1 + .../profile/patient-profile-app-bar.dart | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 4bbbd40e..eb946dea 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/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 8a831c4d..21515268 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -105,6 +105,7 @@ class _PatientProfileScreenState extends State PatientProfileAppBar( patient, isFromLiveCare: isFromLiveCare, + isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 220 diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 467d681b..09c987fd 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -75,13 +75,13 @@ class PatientProfileAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 - ? isInpatient - ? 215 - : isAppointmentHeader - ? 325 - : 200 - : height, + // height: height == 0 + // ? isInpatient + // ? 215 + // : isAppointmentHeader + // ? 325 + // : 200 + // : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -324,10 +324,11 @@ class PatientProfileAppBar extends StatelessWidget ), ), ), - if(isInpatient) + // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(patient.admissionDate != null && patient.admissionDate.isNotEmpty) Container( child: RichText( text: new TextSpan( @@ -547,6 +548,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? 215 : isAppointmentHeader ? 325 : 200 + ? isInpatient ? 160 : isAppointmentHeader ? 290 : 160 : height); } From 712a742aa230355c881da306055719ba2143499f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 13 Jun 2021 17:26:14 +0300 Subject: [PATCH 080/124] fix small issue --- .../patients/profile/patient-profile-app-bar.dart | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 09c987fd..1a47dd00 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -314,12 +314,15 @@ class PatientProfileAppBar extends StatelessWidget children: [ new TextSpan( text: "Result Date: ", - style: TextStyle(fontSize: 14)), + style: TextStyle( fontSize: 10, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + fontFamily: 'Poppins',)), new TextSpan( text: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 14)), + fontWeight: FontWeight.w700, fontSize: 12)), ], ), ), @@ -519,7 +522,7 @@ class PatientProfileAppBar extends StatelessWidget !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), + fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), ), AppText( '${AppDateUtils @@ -527,7 +530,7 @@ class PatientProfileAppBar extends StatelessWidget appointmentDate, isArabic: projectViewModel .isArabic)}', - fontSize: 14, + fontSize: 12, ) ], ) @@ -548,6 +551,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? 160 : isAppointmentHeader ? 290 : 160 + ? isInpatient ? 160 : isAppointmentHeader ? 290 : 170 : height); } From f60ff85e319e8d325b0dc9383d8523cd1a994a03 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Mon, 14 Jun 2021 10:54:51 +0300 Subject: [PATCH 081/124] no message --- ios/Runner/AppDelegate.swift | 1 - .../hide_video_icon.png | Bin 175 -> 906 bytes ios/Runner/Base.lproj/Main.storyboard | 16 +++---- ios/Runner/MainAppViewController.swift | 35 ++++++---------- ios/Runner/VCEmbeder.swift | 1 + ios/Runner/VideoCallViewController.swift | 39 +++++++++--------- .../patient_profile_screen.dart | 25 ++++++++--- lib/util/VideoChannel.dart | 20 ++++----- lib/util/helpers.dart | 7 ++++ ...ent-profile-header-new-design-app-bar.dart | 7 +--- pubspec.lock | 2 +- pubspec.yaml | 2 +- 12 files changed, 79 insertions(+), 76 deletions(-) diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index dc938e36..8ebd4235 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -49,7 +49,6 @@ import OpenTok navVC.modalPresentationStyle = .fullScreen window.rootViewController?.present(navVC, animated: true, completion: nil) - } } diff --git a/ios/Runner/Assets.xcassets/hide_video_icon.imageset/hide_video_icon.png b/ios/Runner/Assets.xcassets/hide_video_icon.imageset/hide_video_icon.png index 8dea84b1de80408985f9dc89728ab042c7750a7c..40889f7710b0615cba211a52f145ae817ecad67b 100644 GIT binary patch literal 906 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nC-mUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lxRtf@J#ddWzYh$IT%O>_%)r1c48n{Iv*t)JFfcJ@hD4M^`1)8S=jZArrsOB3 z>Q&?xfOIj~R9FF-xv3?I3Kh9IdBs*0wn|_XRzNmLSYJs2tfVB{Rw=?aK*2e`C{@8s z&p^*W$&O1wLBXadCCw_x#SN+*$g@?-C@Cqh($_C9FV`zK*2^zS*Eh7ZwA42+(l;{F z1**_3uFNY*tkBIXR)!b?Gsh*hIJqdZpd>RtPXT0ZVp4u-iLH_n$Rap^xU(cP4PjGW zG1OZ?59)(t^bPe4^s#A6t;oco4I~562KE=kIvbE-R{lkqsXzyVoMmTd1GWG~4Bd9J*EaW`dB5fYK%l^v_RH}Bo5VQqYnxsq(Fnj2v`&tC3ajk z`tazr<7$5V$ORbV$(}BbAsMW1FB)<&DDbcteEnY^W`4X(Q{<#C7yH!`9z}-+21X_p z4gm!iqk}aqrn0y8bKckGm6PXg+H~}tt^CVv3-iq`@m{M&QU}%G#mXmkiG{0r - - - - - - - @@ -114,6 +107,13 @@ + + + + + + + @@ -333,7 +333,7 @@ - + diff --git a/ios/Runner/MainAppViewController.swift b/ios/Runner/MainAppViewController.swift index 3849635e..87610042 100644 --- a/ios/Runner/MainAppViewController.swift +++ b/ios/Runner/MainAppViewController.swift @@ -35,8 +35,6 @@ class MainAppViewController: FlutterViewController{ switch call.method { case "openVideoCall": self.startVideoCall(result: result, call: call) - case "showVideo": - self.showVideo() default: result(FlutterMethodNotImplemented) } @@ -72,8 +70,10 @@ extension MainAppViewController : ICallProtocol{ } } - private func showVideo(){ - videoCallContainer.isHidden = false + private func showVideo(show:Bool){ + UIView.transition(with: view, duration: 0.5, options: .transitionCrossDissolve, animations: { + self.videoCallContainer.isHidden = !show + }) } private func startVideoCall(result: @escaping FlutterResult, call:FlutterMethodCall) { @@ -82,17 +82,16 @@ extension MainAppViewController : ICallProtocol{ if let arguments = call.arguments as? NSDictionary{ showVideoCallView(true) - videoCallViewController.onMinimize = { min in - self.minimizeVideoCall(min) + videoCallViewController.onFloat = { min in + self.floatVideoCallView(min) } - videoCallViewController.onHide = { - self.videoCallContainer.isHidden = true - self.videoCallChannel?.invokeMethod("onHide", arguments: nil) + videoCallViewController.onCallConnect = { + self.videoCallChannel?.invokeMethod("onCallConnected",arguments: nil) } - videoCallViewController.onVideoDuration = { duration in - self.videoCallChannel?.invokeMethod("onVideoDuration", arguments: duration) + videoCallViewController.onCallDisconnect = { + self.showVideoCallView(false) + self.videoCallChannel?.invokeMethod("onCallDisconnected",arguments: nil) } - videoCallViewController.onClose = videoCallClosed videoCallViewController.callBack = self videoCallViewController.start(params: VideoCallRequestParameters(dictionary: arguments)) } @@ -100,7 +99,7 @@ extension MainAppViewController : ICallProtocol{ } - private func minimizeVideoCall(_ value:Bool){ + private func floatVideoCallView(_ value:Bool){ videoCallContainer.enable(value) UIView.animate(withDuration: 0.5) { @@ -119,20 +118,11 @@ extension MainAppViewController : ICallProtocol{ } private func showVideoCallView(_ value:Bool){ - videoCallContainer.alpha = value ? 0.0 : 1 - self.videoCallContainer.isHidden = !value - UIView.animate(withDuration: 0.5) { - self.videoCallContainer.alpha = value ? 1.0 : 0.0 - } completion: { complete in self.videoCallContainer.isHidden = !value } } - private func videoCallClosed(){ - showVideoCallView(false) - } - func sessionDone(res: Any) { videoCallFlutterResult?(res) } @@ -144,7 +134,6 @@ extension MainAppViewController : ICallProtocol{ func setVideoViewConstrints(){ let screen = UIScreen.main.bounds - videoCallContainer.translatesAutoresizingMaskIntoConstraints = false diff --git a/ios/Runner/VCEmbeder.swift b/ios/Runner/VCEmbeder.swift index 7e2ea0fd..9617a247 100644 --- a/ios/Runner/VCEmbeder.swift +++ b/ios/Runner/VCEmbeder.swift @@ -54,6 +54,7 @@ class ViewEmbedder { let w = container.frame.size.width; let h = container.frame.size.height; child.view.frame = CGRect(x: 0, y: 0, width: w, height: h) + child.view.backgroundColor = UIColor.black child.view.fill(to: container) } diff --git a/ios/Runner/VideoCallViewController.swift b/ios/Runner/VideoCallViewController.swift index fd25541b..27268128 100644 --- a/ios/Runner/VideoCallViewController.swift +++ b/ios/Runner/VideoCallViewController.swift @@ -34,11 +34,11 @@ class VideoCallViewController: UIViewController { var seconds = 30 var isUserConnect : Bool = false - var onMinimize:((Bool)->Void)? = nil - var onHide:(()->Void)? = nil - var onVideoDuration:((String)->Void)? = nil - var onClose:(()->Void)? = nil - + var onFloat:((Bool)->Void)? = nil + var onMinimize:(()->Void)? = nil + var onCallConnect:(()->Void)? = nil + var onCallDisconnect:(()->Void)? = nil + @IBOutlet weak var lblRemoteUsername: UILabel! @@ -61,6 +61,7 @@ class VideoCallViewController: UIViewController { @IBOutlet weak var remoteVideo: UIView! @IBOutlet weak var localVideo: UIView!{ didSet{ + localVideo.layer.borderColor = UIColor.white.cgColor localVideoDraggable = localVideo?.superview as? AADraggableView localVideoDraggable?.reposition = .edgesOnly } @@ -74,7 +75,6 @@ class VideoCallViewController: UIViewController { @IBAction func didClickMuteButton(_ sender: UIButton) { sender.isSelected = !sender.isSelected publisher!.publishAudio = !sender.isSelected - } @IBAction func didClickSpeakerButton(_ sender: UIButton) { @@ -113,24 +113,24 @@ class VideoCallViewController: UIViewController { } @IBAction func hideVideoBtnTapped(_ sender: Any) { - onHide?() + onMinimize?() } - var minimized = false + var floated = false @IBAction func onMinimize(_ sender: UIButton) { - minimized = !minimized - onMinimize?(minimized) - sender.isSelected = minimized + floated = !floated + onFloat?(floated) + sender.isSelected = floated - NSLayoutConstraint.activate(minimized ? minimizeConstraint : maximisedConstraint) - NSLayoutConstraint.deactivate(minimized ? maximisedConstraint : minimizeConstraint) - localVideoDraggable?.enable(!minimized) + NSLayoutConstraint.activate(floated ? minimizeConstraint : maximisedConstraint) + NSLayoutConstraint.deactivate(floated ? maximisedConstraint : minimizeConstraint) + localVideoDraggable?.enable(!floated) - lblRemoteUsername.isHidden = minimized - hideVideoBtn.isHidden = !minimized + lblRemoteUsername.isHidden = floated + hideVideoBtn.isHidden = !floated lblCallDuration.superview?.isHidden = !hideVideoBtn.isHidden - let min_ = minimized + let min_ = floated UIView.animate(withDuration: 0.5) { self.videoMuteBtn.isHidden = min_ self.micMuteBtn.isHidden = min_ @@ -157,7 +157,6 @@ class VideoCallViewController: UIViewController { let durationString = "\(mins):\(secs)" self.lblCallDuration.text = durationString - self.onVideoDuration?(durationString) } } @@ -277,7 +276,8 @@ class VideoCallViewController: UIViewController { dismiss(animated: true) } dismiss(animated: true) - onClose?() + onCallDisconnect?() + durationTimer?.invalidate() } func requestCameraPermissionsIfNeeded() { @@ -435,6 +435,7 @@ extension VideoCallViewController: OTSessionDelegate { remoteVideo.addSubview(subscriberView) startUpdateCallDuration() + onCallConnect?() } func setupSubscribe(_ stream: OTStream?) { diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index f2a52411..5212df0c 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:quiver/async.dart'; import '../../../../routes.dart'; @@ -95,6 +96,23 @@ class _PatientProfileScreenState extends State _activeTab = 1; } + StreamSubscription callTimer; + callConnected(){ + callTimer = CountdownTimer(Duration(minutes: 1), Duration(seconds: 1)).listen(null) + ..onDone(() { + callTimer.cancel(); + }) + ..onData((data) { + var t = Helpers.timeFrom(duration: data.elapsed); + videoCallDurationStreamController.sink.add(t); + }); + } + + callDisconnected(){ + callTimer.cancel(); + videoCallDurationStreamController.sink.add(null); + } + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; @@ -112,9 +130,6 @@ class _PatientProfileScreenState extends State PatientProfileHeaderNewDesignAppBar( patient, arrivalType ?? '0', patientType, videoCallDurationStream: videoCallDurationStream, - onVideoDurationTap: (){ - VideoChannel.show(); - }, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, height: (patient.patientStatusType != null && @@ -322,9 +337,7 @@ class _PatientProfileScreenState extends State onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, - onVideoDuration: (duration){ - videoCallDurationStreamController.sink.add(duration); - }, + onCallConnected: callConnected, onCallEnd: () { var asd=""; // WidgetsBinding.instance.addPostFrameCallback((_) { diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index a9c2b5e2..94e79b7e 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -12,18 +12,19 @@ class VideoChannel{ static const _channel = const MethodChannel("Dr.cloudSolution/videoCall"); static openVideoCallScreen({kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID, String generalId,int doctorId, Function() onCallEnd , - Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onHide, Function(String) onVideoDuration}) async { + Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { - onHide = onHide ?? (){}; - onVideoDuration = onVideoDuration ?? (v){}; + onCallConnected = onCallConnected ?? (){}; + onCallDisconnected = onCallDisconnected ?? (){}; var result; try { _channel.setMethodCallHandler((call) { - if(call.method == 'onHide'){ - onHide(); - }else if(call.method == 'onVideoDuration'){ - onVideoDuration(call.arguments); + if(call.method == 'onCallConnected'){ + onCallConnected(); + } + if(call.method == 'onCallDisconnected'){ + onCallDisconnected(); } return true as dynamic; }); @@ -44,7 +45,6 @@ class VideoChannel{ ); if(result['callResponse'] == 'CallEnd') { onCallEnd(); - onVideoDuration(null); } else { SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); @@ -56,10 +56,6 @@ class VideoChannel{ } } - - static show(){ - _channel.invokeMethod("showVideo"); - } } \ No newline at end of file diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 634abd02..7232f0c9 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -270,4 +270,11 @@ class Helpers { var htmlRegex = RegExp("<(“[^”]*”|'[^’]*’|[^'”>])*>"); return htmlRegex.hasMatch(text); } + + static String timeFrom({Duration duration}) { + String twoDigits(int n) => n.toString().padLeft(2, "0"); + String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); + String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); + return "$twoDigitMinutes:$twoDigitSeconds"; + } } diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 69bb9758..f2a32e63 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -22,10 +22,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isFromLiveCare; final Stream videoCallDurationStream; - final VoidCallback onVideoDurationTap; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false, this.videoCallDurationStream, this.onVideoDurationTap}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false, this.videoCallDurationStream}); @override Widget build(BuildContext context) { @@ -94,11 +93,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget StreamBuilder( stream: videoCallDurationStream, builder: (BuildContext context, AsyncSnapshot snapshot) { - if(snapshot.hasData) + if(snapshot.hasData && snapshot.data != null) return InkWell( onTap: (){ - if(onVideoDurationTap != null) - onVideoDurationTap(); }, child: Container( decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), diff --git a/pubspec.lock b/pubspec.lock index 77df9848..cac3f27b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -813,7 +813,7 @@ packages: source: hosted version: "0.1.8" quiver: - dependency: transitive + dependency: "direct main" description: name: quiver url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index 973e8800..1429bc3e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -90,7 +90,7 @@ dependencies: speech_to_text: path: speech_to_text - + quiver: ^2.1.5 # Html Editor Enhanced html_editor_enhanced: ^1.3.0 From 07857b28cd9efec18e228fb58bcb4d583f3a7dfd Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 11:22:12 +0300 Subject: [PATCH 082/124] change the code of header profile to new implementation --- .../patient_profile_app_bar_model.dart | 86 +++ lib/screens/live_care/end_call_screen.dart | 27 +- .../medical-file/health_summary_page.dart | 6 +- .../medical-file/medical_file_details.dart | 72 ++- lib/screens/patients/ECGPage.dart | 5 +- .../insurance_approval_screen_patient.dart | 6 +- .../patients/insurance_approvals_details.dart | 6 +- .../profile/UCAF/UCAF-detail-screen.dart | 8 +- .../profile/UCAF/UCAF-input-screen.dart | 7 +- .../admission-request-first-screen.dart | 6 +- .../admission-request-third-screen.dart | 7 +- .../admission-request_second-screen.dart | 6 +- .../lab_result/laboratory_result_page.dart | 10 +- .../profile/lab_result/labs_home_page.dart | 9 +- .../MedicalReportDetailPage.dart | 10 +- .../medical_report/MedicalReportPage.dart | 7 +- .../profile/note/progress_note_screen.dart | 9 +- .../patient_profile_screen.dart | 49 +- .../radiology/radiology_details_page.dart | 7 +- .../radiology/radiology_home_page.dart | 8 +- .../refer-patient-screen-in-patient.dart | 8 +- .../referral/refer-patient-screen.dart | 6 +- .../soap_update/update_soap_index.dart | 29 +- .../vital_sign/vital_sign_details_screen.dart | 6 +- .../vital_sign_item_details_screen.dart | 8 +- .../prescription_item_in_patient_page.dart | 6 +- .../prescription/prescription_items_page.dart | 12 +- .../prescription/prescriptions_page.dart | 8 +- lib/screens/procedures/procedure_screen.dart | 8 +- lib/screens/sick-leave/add-sickleave.dart | 9 +- lib/screens/sick-leave/show-sickleave.dart | 7 +- .../profile/patient-profile-app-bar-copy.dart | 583 ++++++++++++++++++ lib/widgets/shared/app_scaffold_widget.dart | 34 +- 33 files changed, 880 insertions(+), 195 deletions(-) create mode 100644 lib/models/patient/profile/patient_profile_app_bar_model.dart create mode 100644 lib/widgets/patients/profile/patient-profile-app-bar-copy.dart diff --git a/lib/models/patient/profile/patient_profile_app_bar_model.dart b/lib/models/patient/profile/patient_profile_app_bar_model.dart new file mode 100644 index 00000000..f4654a29 --- /dev/null +++ b/lib/models/patient/profile/patient_profile_app_bar_model.dart @@ -0,0 +1,86 @@ +import '../patiant_info_model.dart'; + +class PatientProfileAppBarModel { + double height; + bool isInpatient; + bool isDischargedPatient; + bool isFromLiveCare; + PatiantInformtion patient; + String doctorName; + String branch; + DateTime appointmentDate; + String profileUrl; + String invoiceNO; + String orderNo; + bool isPrescriptions; + bool isMedicalFile; + String episode; + String visitDate; + String clinic; + bool isAppointmentHeader; + bool isFromLabResult; + + PatientProfileAppBarModel( + {this.height = 0.0, + this.isInpatient= false, + this.isDischargedPatient= false, + this.isFromLiveCare= false, + this.patient, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo, + this.isPrescriptions= false, + this.isMedicalFile= false, + this.episode, + this.visitDate, + this.clinic, + this.isAppointmentHeader = false, + this.isFromLabResult =false}); + + PatientProfileAppBarModel.fromJson(Map json) { + height = json['height']; + isInpatient = json['isInpatient']; + isDischargedPatient = json['isDischargedPatient']; + isFromLiveCare = json['isFromLiveCare']; + patient = json['patient']; + doctorName = json['doctorName']; + branch = json['branch']; + appointmentDate = json['appointmentDate']; + profileUrl = json['profileUrl']; + invoiceNO = json['invoiceNO']; + orderNo = json['orderNo']; + isPrescriptions = json['isPrescriptions']; + isMedicalFile = json['isMedicalFile']; + episode = json['episode']; + visitDate = json['visitDate']; + clinic = json['clinic']; + isAppointmentHeader = json['isAppointmentHeader']; + isFromLabResult = json['isFromLabResult']; + } + + Map toJson() { + final Map data = new Map(); + data['height'] = this.height; + data['isInpatient'] = this.isInpatient; + data['isDischargedPatient'] = this.isDischargedPatient; + data['isFromLiveCare'] = this.isFromLiveCare; + data['patient'] = this.patient; + data['doctorName'] = this.doctorName; + data['branch'] = this.branch; + data['appointmentDate'] = this.appointmentDate; + data['profileUrl'] = this.profileUrl; + data['invoiceNO'] = this.invoiceNO; + data['orderNo'] = this.orderNo; + data['isPrescriptions'] = this.isPrescriptions; + data['isMedicalFile'] = this.isMedicalFile; + data['episode'] = this.episode; + data['visitDate'] = this.visitDate; + data['clinic'] = this.clinic; + data['isAppointmentHeader'] = this.isAppointmentHeader; + data['isFromLabResult'] = this.isFromLabResult; + return data; + } +} diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 76e87a87..9903dd57 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart' import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/live-care_transfer_to_admin.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; @@ -13,7 +14,6 @@ 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/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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'; @@ -182,18 +182,21 @@ class _EndCallScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBarTitle: TranslationBase + .of(context) + .patientProfile, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileAppBar( - widget.patient, - isInpatient: isInpatient, - height: (widget.patient.patientStatusType != null && - widget.patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, + + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: widget.patient, isInpatient:isInpatient, height: (widget.patient.patientStatusType != null && + widget.patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, isDischargedPatient: isDischargedPatient), body: Container( height: !isSearchAndOut diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index 6b4b066c..35d935d1 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/doctor_card.dart'; @@ -30,8 +30,8 @@ class _HealthSummaryPageState extends State { builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient: isInpatient, ), isShowAppBar: true, diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index b53284a9..439eac6b 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/expandable-widget-header-body.dart'; @@ -85,14 +85,44 @@ class _MedicalFileDetailsState extends State { this.clinicName, this.episode, this.doctorImage}); + bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; bool isAssessmentExpand = true; + PatientProfileAppBarModel patientProfileAppBarModel; + ProjectViewModel projectViewModel; + @override - Widget build(BuildContext context) { + void didChangeDependencies() { ProjectViewModel projectViewModel = Provider.of(context); + patientProfileAppBarModel = PatientProfileAppBarModel( + patient: patient, + doctorName: doctorName, + profileUrl: doctorImage, + clinic: clinicName, + isPrescriptions: true, + isMedicalFile: true, + episode: episode, + visitDate: + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', + isAppointmentHeader: true, + ); + + // TODO: implement didChangeDependencies + super.didChangeDependencies(); + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { if (model.medicalFileList.length == 0) { @@ -102,30 +132,20 @@ class _MedicalFileDetailsState extends State { builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( - appBar: PatientProfileAppBar( - patient, - doctorName: doctorName, - profileUrl: doctorImage, - clinic: clinicName, - isPrescriptions: true, - isMedicalFile: true, - episode: episode, - visitDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', - isAppointmentHeader: true, - ), - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Center( - child: Container( - child: Column( - children: [ - model.medicalFileList.length != 0 && + patientProfileAppBarModel: patientProfileAppBarModel, + isShowAppBar: true, + appBarTitle: TranslationBase + .of(context) + .medicalReport + .toUpperCase(), + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Center( + child: Container( + child: Column( + children: [ + model.medicalFileList.length != 0 && model .medicalFileList[0] .entityList[0] diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba4c108c..9caef9cc 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -3,10 +3,10 @@ import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.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/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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:flutter/cupertino.dart'; @@ -31,7 +31,8 @@ class ECGPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Color(0xffF8F8F8), - appBar: PatientProfileAppBar(patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 1ab0734b..79a548ca 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -2,9 +2,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/doctor_card_insurance.dart'; @@ -44,8 +44,8 @@ class _InsuranceApprovalScreenNewState : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient: isInpatient, ), isShowAppBar: true, diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 0945df37..10db8a6a 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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:flutter/cupertino.dart'; @@ -54,8 +54,8 @@ class _InsuranceApprovalsDetailsState extends State { AppScaffold( isShowAppBar: true, baseViewModel: model, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: + PatientProfileAppBarModel(patient: patient), body: patient.admissionNo != null ? SingleChildScrollView( child: Container( diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 081f1a6e..2f552132 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -7,12 +7,12 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.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/patient-profile-app-bar.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'; @@ -47,8 +47,10 @@ class _UcafDetailScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient), + + + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), appBarTitle: TranslationBase.of(context).ucaf, body: Column( children: [ diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 3bbc6637..27db9448 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -1,13 +1,12 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.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/patient-profile-app-bar.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'; @@ -65,8 +64,8 @@ class _UCAFInputScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), appBarTitle: TranslationBase.of(context).ucaf, body: model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index f0ccaece..40d0ce7d 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_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/patients/profile/patient-profile-app-bar.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'; @@ -61,8 +61,8 @@ class _AdmissionRequestThirdScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 563b4827..af1a4b0d 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -5,10 +5,10 @@ import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_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/patients/profile/patient-profile-app-bar.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'; @@ -52,8 +52,9 @@ class _AdmissionRequestThirdScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), + appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index dc79b2be..a9937682 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -6,11 +6,11 @@ import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/patient-profile-app-bar.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'; @@ -74,8 +74,8 @@ class _AdmissionRequestSecondScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { 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..88f2cea7 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -38,12 +38,10 @@ class _LaboratoryResultPageState extends State { isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBar: PatientProfileAppBar( - widget.patient, - + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:widget.patient, isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate, - ), + appointmentDate: widget.patientLabOrders.orderDate,), baseViewModel: model, body: AppScaffold( 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..daed5477 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/doctor_card.dart'; @@ -52,11 +52,8 @@ class _LabsHomePageState extends State { baseViewModel: model, backgroundColor: Colors.grey[100], isShowAppBar: true, - appBar: PatientProfileAppBar( - patient, - - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index ab24f8e0..0557117c 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -1,16 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.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/models/patient/MedicalReport/MeidcalReportModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.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/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; @@ -31,9 +28,8 @@ class MedicalReportDetailPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: Container( child: SingleChildScrollView( child: Column( diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index aa9d0b58..45b5f788 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel. 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/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -11,7 +12,6 @@ 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/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/card_with_bg_widget.dart'; @@ -43,9 +43,8 @@ class MedicalReportPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 723ee75f..b881adce 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -4,13 +4,13 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart import 'package:doctor_app_flutter/core/viewModel/patient_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/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/note/update_note.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; @@ -87,11 +87,8 @@ class _ProgressNoteState extends State { backgroundColor: Theme .of(context) .scaffoldBackgroundColor, - // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileAppBar( - patient, - isInpatient: true, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient, isInpatient: true,), body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 4e98aa22..b79331b4 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; @@ -14,7 +15,7 @@ import 'package:doctor_app_flutter/util/VideoChannel.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/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar-copy.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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'; @@ -102,29 +103,31 @@ class _PatientProfileScreenState extends State children: [ Column( children: [ - PatientProfileAppBar( - patient, - isFromLiveCare: isFromLiveCare, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 220 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient: isDischargedPatient), + PatientProfileAppBarCopy( + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, + isFromLiveCare: isFromLiveCare, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 220 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), + ), + Container( + height: !isSearchAndOut + ? isDischargedPatient + ? MediaQuery.of(context).size.height * 0.64 + : MediaQuery.of(context).size.height * 0.65 + : MediaQuery.of(context).size.height * 0.69, + child: ListView( + children: [ Container( - height: !isSearchAndOut - ? isDischargedPatient - ? MediaQuery.of(context).size.height * 0.64 - : MediaQuery.of(context).size.height * 0.65 - : MediaQuery.of(context).size.height * 0.69, - child: ListView( - children: [ - Container( - child: isSearchAndOut - ? ProfileGridForSearch( - patient: patient, + child: isSearchAndOut + ? ProfileGridForSearch( + patient: patient, patientType: patientType, arrivalType: arrivalType, isInpatient: isInpatient, diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 48bef68a..9e29543e 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.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/profile/patient-profile-app-bar.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/secondary_button.dart'; @@ -35,8 +35,8 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, appointmentDate: finalRadiology.orderDate, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, @@ -44,7 +44,6 @@ class RadiologyDetailsPage extends StatelessWidget { profileUrl: finalRadiology.doctorImageURL, invoiceNO: finalRadiology.invoiceNo.toString(), isAppointmentHeader: true, - ), isShowAppBar: true, baseViewModel: model, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 3d8d527c..1ca699bf 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/doctor_card.dart'; @@ -50,10 +50,8 @@ class _RadiologyHomePageState extends State { isShowAppBar: true, backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 66fd22fd..337fd3e6 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -5,10 +5,10 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_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/patients/profile/patient-profile-app-bar.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'; @@ -136,10 +136,8 @@ class _PatientMakeInPatientReferralScreenState extends State { baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index 60597b11..cfe558aa 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -5,9 +5,10 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar-copy.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -82,18 +83,20 @@ class _UpdateSoapIndexState extends State mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileAppBar(patient), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - - Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.73, - child: PageView( - physics: NeverScrollableScrollPhysics(), + PatientProfileAppBarCopy( + patientProfileAppBarModel: + PatientProfileAppBarModel(patient: patient), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.73, + child: PageView( + physics: NeverScrollableScrollPhysics(), controller: _controller, onPageChanged: (index) { setState(() { diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 23266095..d97cc625 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/errors/error_message.dart'; @@ -40,8 +40,8 @@ class VitalSignDetailsScreen extends StatelessWidget { baseViewModel: mode, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 0ed9da56..999c4b91 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -2,12 +2,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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:flutter/material.dart'; @@ -190,8 +190,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { appBarTitle: pageTitle, backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - appBar: PatientProfileAppBar( - patient,), + + + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index 7cf33935..71f2fdf6 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_pati import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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:flutter/cupertino.dart'; @@ -44,8 +44,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, - appBar: PatientProfileAppBar( - patient), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index b97343c4..04c7c144 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/dialogs/ShowImageDialog.dart'; @@ -28,12 +28,13 @@ class PrescriptionItemsPage extends StatelessWidget { isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, - appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, clinic: prescriptions.clinicDescription, branch: prescriptions.name, isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + prescriptions.appointmentDate), doctorName: prescriptions.doctorName, profileUrl: prescriptions.doctorImageURL, isAppointmentHeader: true, @@ -42,11 +43,10 @@ class PrescriptionItemsPage extends StatelessWidget { child: Container( child: Column( children: [ - if (!prescriptions.isInOutPatient) ...List.generate( model.prescriptionReportList.length, - (index) => Container( + (index) => Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: Colors.white, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 1a99299b..b8a0915a 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; @@ -8,7 +9,6 @@ import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_pag import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/doctor_card.dart'; @@ -35,10 +35,8 @@ class PrescriptionsPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 79371459..91840464 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.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/patient-profile-app-bar.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:flutter/material.dart'; @@ -44,10 +44,8 @@ class ProcedureScreen extends StatelessWidget { isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 7b065321..66c3d7af 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,15 +1,14 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; - import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/rounded_container_widget.dart'; @@ -34,10 +33,8 @@ class AddSickLeavScreen extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, isInpatient:isInpatient,), body: SingleChildScrollView( child: Column(children: [ patient.patientStatusType == 43 diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 726524d8..a1b82576 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/patient-profile-app-bar.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/rounded_container_widget.dart'; @@ -25,9 +25,8 @@ class ShowSickLeaveScreen extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - ), + patientProfileAppBarModel: PatientProfileAppBarModel( + patient:patient), body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/widgets/patients/profile/patient-profile-app-bar-copy.dart b/lib/widgets/patients/profile/patient-profile-app-bar-copy.dart new file mode 100644 index 00000000..81cfbd77 --- /dev/null +++ b/lib/widgets/patients/profile/patient-profile-app-bar-copy.dart @@ -0,0 +1,583 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.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'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import 'large_avatar.dart'; + +class PatientProfileAppBarCopy extends StatelessWidget + with PreferredSizeWidget { + final PatientProfileAppBarModel patientProfileAppBarModel; + + PatientProfileAppBarCopy({this.patientProfileAppBarModel}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + int gender = 1; + if (patientProfileAppBarModel.patient.patientDetails != null) { + gender = patientProfileAppBarModel.patient.patientDetails.gender; + } else { + gender = patientProfileAppBarModel.patient.gender; + } + + return Container( + padding: EdgeInsets.only( + left: 0, + right: 5, + bottom: 5, + ), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Color(0xFF2B353E), //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + patientProfileAppBarModel.patient.firstName != null + ? (Helpers.capitalize( + patientProfileAppBarModel.patient.firstName) + + " " + + Helpers.capitalize( + patientProfileAppBarModel.patient.lastName)) + : Helpers.capitalize( + patientProfileAppBarModel.patient.fullName ?? + patientProfileAppBarModel + .patient.patientDetails.fullName), + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + ), + ), + gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + + patientProfileAppBarModel.patient.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + patientProfileAppBarModel.patient.patientStatusType != null + ? Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patientProfileAppBarModel + .patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + patientProfileAppBarModel.patient.startTime != + null + ? AppText( + patientProfileAppBarModel + .patient.startTime != + null + ? patientProfileAppBarModel + .patient.startTime + : '', + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A)) + : SizedBox() + ], + )) + : SizedBox(), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 10, + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + ), + new TextSpan( + text: patientProfileAppBarModel + .patient.patientId + .toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 12, + color: Color(0xFF2E303A), + )), + ], + ), + ), + Row( + children: [ + AppText( + patientProfileAppBarModel.patient.nationalityName ?? + patientProfileAppBarModel + .patient.nationality ?? + patientProfileAppBarModel + .patient.nationalityId ?? + '', + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patientProfileAppBarModel + .patient.nationalityFlagURL != + null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + patientProfileAppBarModel + .patient.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age + " : ", + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + )), + new TextSpan( + text: + "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient.patientDetails != null ? patientProfileAppBarModel.patient.patientDetails.dateofBirth ?? "" : patientProfileAppBarModel.patient.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + )), + ], + ), + ), + ), + + if (patientProfileAppBarModel.patient.appointmentDate != + null && + patientProfileAppBarModel + .patient.appointmentDate.isNotEmpty) + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).appointmentDate + " : ", + fontSize: 10, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + SizedBox( + width: 3.5, + ), + AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + patientProfileAppBarModel + .patient.appointmentDate)), + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + ), + SizedBox( + height: 0.5, + ) + ], + ), + if (patientProfileAppBarModel.isFromLabResult) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: "Result Date: ", + style: TextStyle( + fontSize: 10, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + )), + new TextSpan( + text: + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 12)), + ], + ), + ), + ), + // if(isInpatient) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (patientProfileAppBarModel.patient.admissionDate != + null && + patientProfileAppBarModel + .patient.admissionDate.isNotEmpty) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: patientProfileAppBarModel + .patient.admissionDate == + null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + style: TextStyle(fontSize: 10)), + new TextSpan( + text: patientProfileAppBarModel + .patient.admissionDate == + null + ? "" + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate.toString())))}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + )), + ]))), + if (patientProfileAppBarModel.patient.admissionDate != + null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757)), + if (patientProfileAppBarModel + .isDischargedPatient && + patientProfileAppBarModel + .patient.dischargeDate != + null) + AppText( + "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + ) + else + AppText( + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + ), + ], + ), + ], + ), + ], + ), + ), + ]), + if (patientProfileAppBarModel.isAppointmentHeader) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 30, + height: 30, + margin: EdgeInsets.only( + left: projectViewModel.isArabic ? 10 : 85, + right: projectViewModel.isArabic ? 85 : 10, + top: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border( + bottom: + BorderSide(color: Colors.grey[400], width: 2.5), + left: BorderSide(color: Colors.grey[400], width: 2.5), + )), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: LargeAvatar( + name: patientProfileAppBarModel.doctorName ?? "", + url: patientProfileAppBarModel.profileUrl, + ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), + Expanded( + flex: 5, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + '${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}', + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + fontSize: 12, + ), + if (patientProfileAppBarModel.orderNo != + null && + !patientProfileAppBarModel + .isPrescriptions) + Row( + children: [ + AppText( + 'Order No: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .orderNo ?? + '', + fontSize: 12) + ], + ), + if (patientProfileAppBarModel.invoiceNO != + null && + !patientProfileAppBarModel + .isPrescriptions) + Row( + children: [ + AppText( + 'Invoice: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .invoiceNO ?? + "", + fontSize: 12) + ], + ), + if (patientProfileAppBarModel.branch != + null) + Row( + children: [ + AppText( + 'Branch: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .branch ?? + '', + fontSize: 12) + ], + ), + if (patientProfileAppBarModel.clinic != + null) + Row( + children: [ + AppText( + 'Clinic: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .clinic ?? + '', + fontSize: 12) + ], + ), + if (patientProfileAppBarModel + .isMedicalFile && + patientProfileAppBarModel.episode != + null) + Row( + children: [ + AppText( + 'Episode: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .episode ?? + '', + fontSize: 12) + ], + ), + if (patientProfileAppBarModel + .isMedicalFile && + patientProfileAppBarModel.visitDate != + null) + Row( + children: [ + AppText( + 'Visit Date: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .visitDate ?? + '', + fontSize: 12) + ], + ), + if (!patientProfileAppBarModel + .isMedicalFile) + Row( + children: [ + AppText( + !patientProfileAppBarModel + .isPrescriptions + ? 'Result Date:' + : 'Prescriptions Date ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + fontSize: 12, + ) + ], + ) + ]), + ), + ), + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } + + @override + Size get preferredSize => Size( + double.maxFinite, + patientProfileAppBarModel.height == 0 + ? patientProfileAppBarModel.isInpatient + ? 160 + : patientProfileAppBarModel.isAppointmentHeader + ? 290 + : 170 + : patientProfileAppBarModel.height); +} diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e957b5d4..9bd6ee02 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -2,7 +2,9 @@ import 'package:doctor_app_flutter/config/config.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/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar-copy.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -21,6 +23,8 @@ class AppScaffold extends StatelessWidget { final Widget appBar; final String subtitle; final bool isHomeIcon; + final PatientProfileAppBarModel patientProfileAppBarModel; + AppScaffold( {this.appBarTitle = '', this.body, @@ -30,7 +34,9 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle}); + this.appBar, + this.subtitle, + this.patientProfileAppBarModel}); @override Widget build(BuildContext context) { @@ -43,18 +49,20 @@ class AppScaffold extends StatelessWidget { child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, appBar: isShowAppBar - ? appBar ?? - AppBar( - elevation: 0, - backgroundColor: Colors.white, //HexColor('#515B5D'), - textTheme: TextTheme( - headline6: TextStyle( - color: Colors.black87, - fontSize: 16.8, - )), - title: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ + ? patientProfileAppBarModel != null ? PatientProfileAppBarCopy( + patientProfileAppBarModel: patientProfileAppBarModel,) : appBar ?? + AppBar( + elevation: 0, + backgroundColor: Colors.white, + //HexColor('#515B5D'), + textTheme: TextTheme( + headline6: TextStyle( + color: Colors.black87, + fontSize: 16.8, + )), + title: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ Text(appBarTitle.toUpperCase()), if(subtitle!=null) Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), From 6fd9af9b26ad89e7de3a6f6559d135c0d3c47f07 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 11:23:59 +0300 Subject: [PATCH 083/124] change the name of the file --- .../patient_profile_screen.dart | 4 +- .../soap_update/update_soap_index.dart | 4 +- .../profile/patient-profile-app-bar-copy.dart | 583 ------------------ .../profile/patient-profile-app-bar.dart | 537 ++++++++-------- lib/widgets/shared/app_scaffold_widget.dart | 4 +- 5 files changed, 288 insertions(+), 844 deletions(-) delete mode 100644 lib/widgets/patients/profile/patient-profile-app-bar-copy.dart diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index b79331b4..e0a83857 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/util/VideoChannel.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/patient-profile-app-bar-copy.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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'; @@ -103,7 +103,7 @@ class _PatientProfileScreenState extends State children: [ Column( children: [ - PatientProfileAppBarCopy( + PatientProfileAppBar( patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, isFromLiveCare: isFromLiveCare, diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index cfe558aa..7df94130 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar-copy.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -83,7 +83,7 @@ class _UpdateSoapIndexState extends State mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileAppBarCopy( + PatientProfileAppBar( patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), ), diff --git a/lib/widgets/patients/profile/patient-profile-app-bar-copy.dart b/lib/widgets/patients/profile/patient-profile-app-bar-copy.dart deleted file mode 100644 index 81cfbd77..00000000 --- a/lib/widgets/patients/profile/patient-profile-app-bar-copy.dart +++ /dev/null @@ -1,583 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.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'; -import 'package:provider/provider.dart'; -import 'package:url_launcher/url_launcher.dart'; - -import 'large_avatar.dart'; - -class PatientProfileAppBarCopy extends StatelessWidget - with PreferredSizeWidget { - final PatientProfileAppBarModel patientProfileAppBarModel; - - PatientProfileAppBarCopy({this.patientProfileAppBarModel}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - - int gender = 1; - if (patientProfileAppBarModel.patient.patientDetails != null) { - gender = patientProfileAppBarModel.patient.patientDetails.gender; - } else { - gender = patientProfileAppBarModel.patient.gender; - } - - return Container( - padding: EdgeInsets.only( - left: 0, - right: 5, - bottom: 5, - ), - decoration: BoxDecoration( - color: Colors.white, - ), - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Column( - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Color(0xFF2B353E), //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - patientProfileAppBarModel.patient.firstName != null - ? (Helpers.capitalize( - patientProfileAppBarModel.patient.firstName) + - " " + - Helpers.capitalize( - patientProfileAppBarModel.patient.lastName)) - : Helpers.capitalize( - patientProfileAppBarModel.patient.fullName ?? - patientProfileAppBarModel - .patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 1.8, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - color: Color(0xFF2B353E), - ), - ), - gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 4), - child: InkWell( - onTap: () { - launch("tel://" + - patientProfileAppBarModel.patient.mobileNumber); - }, - child: Icon( - Icons.phone, - color: Colors.black87, - ), - ), - ), - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - patientProfileAppBarModel.patient.patientStatusType != null - ? Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - patientProfileAppBarModel - .patient.patientStatusType == - 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: Colors.green, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), - patientProfileAppBarModel.patient.startTime != - null - ? AppText( - patientProfileAppBarModel - .patient.startTime != - null - ? patientProfileAppBarModel - .patient.startTime - : '', - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A)) - : SizedBox() - ], - )) - : SizedBox(), - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 10, - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - ), - new TextSpan( - text: patientProfileAppBarModel - .patient.patientId - .toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 12, - color: Color(0xFF2E303A), - )), - ], - ), - ), - Row( - children: [ - AppText( - patientProfileAppBarModel.patient.nationalityName ?? - patientProfileAppBarModel - .patient.nationality ?? - patientProfileAppBarModel - .patient.nationalityId ?? - '', - fontWeight: FontWeight.bold, - fontSize: 12, - ), - patientProfileAppBarModel - .patient.nationalityFlagURL != - null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - patientProfileAppBarModel - .patient.nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).age + " : ", - style: TextStyle( - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - )), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient.patientDetails != null ? patientProfileAppBarModel.patient.patientDetails.dateofBirth ?? "" : patientProfileAppBarModel.patient.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare)}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - )), - ], - ), - ), - ), - - if (patientProfileAppBarModel.patient.appointmentDate != - null && - patientProfileAppBarModel - .patient.appointmentDate.isNotEmpty) - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).appointmentDate + " : ", - fontSize: 10, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - SizedBox( - width: 3.5, - ), - AppText( - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - patientProfileAppBarModel - .patient.appointmentDate)), - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - ), - SizedBox( - height: 0.5, - ) - ], - ), - if (patientProfileAppBarModel.isFromLabResult) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: "Result Date: ", - style: TextStyle( - fontSize: 10, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - )), - new TextSpan( - text: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 12)), - ], - ), - ), - ), - // if(isInpatient) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (patientProfileAppBarModel.patient.admissionDate != - null && - patientProfileAppBarModel - .patient.admissionDate.isNotEmpty) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: patientProfileAppBarModel - .patient.admissionDate == - null - ? "" - : TranslationBase.of(context) - .admissionDate + - " : ", - style: TextStyle(fontSize: 10)), - new TextSpan( - text: patientProfileAppBarModel - .patient.admissionDate == - null - ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate.toString())))}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - )), - ]))), - if (patientProfileAppBarModel.patient.admissionDate != - null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757)), - if (patientProfileAppBarModel - .isDischargedPatient && - patientProfileAppBarModel - .patient.dischargeDate != - null) - AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - ) - else - AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - ), - ], - ), - ], - ), - ], - ), - ), - ]), - if (patientProfileAppBarModel.isAppointmentHeader) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 30, - height: 30, - margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border( - bottom: - BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), - )), - ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: LargeAvatar( - name: patientProfileAppBarModel.doctorName ?? "", - url: patientProfileAppBarModel.profileUrl, - ), - width: 25, - height: 25, - margin: EdgeInsets.only(top: 10), - ), - Expanded( - flex: 5, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - '${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}', - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - fontSize: 12, - ), - if (patientProfileAppBarModel.orderNo != - null && - !patientProfileAppBarModel - .isPrescriptions) - Row( - children: [ - AppText( - 'Order No: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .orderNo ?? - '', - fontSize: 12) - ], - ), - if (patientProfileAppBarModel.invoiceNO != - null && - !patientProfileAppBarModel - .isPrescriptions) - Row( - children: [ - AppText( - 'Invoice: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .invoiceNO ?? - "", - fontSize: 12) - ], - ), - if (patientProfileAppBarModel.branch != - null) - Row( - children: [ - AppText( - 'Branch: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .branch ?? - '', - fontSize: 12) - ], - ), - if (patientProfileAppBarModel.clinic != - null) - Row( - children: [ - AppText( - 'Clinic: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .clinic ?? - '', - fontSize: 12) - ], - ), - if (patientProfileAppBarModel - .isMedicalFile && - patientProfileAppBarModel.episode != - null) - Row( - children: [ - AppText( - 'Episode: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .episode ?? - '', - fontSize: 12) - ], - ), - if (patientProfileAppBarModel - .isMedicalFile && - patientProfileAppBarModel.visitDate != - null) - Row( - children: [ - AppText( - 'Visit Date: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .visitDate ?? - '', - fontSize: 12) - ], - ), - if (!patientProfileAppBarModel - .isMedicalFile) - Row( - children: [ - AppText( - !patientProfileAppBarModel - .isPrescriptions - ? 'Result Date:' - : 'Prescriptions Date ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', - fontSize: 12, - ) - ], - ) - ]), - ), - ), - ], - ), - ), - ), - ], - ) - ], - ), - ), - ); - } - - @override - Size get preferredSize => Size( - double.maxFinite, - patientProfileAppBarModel.height == 0 - ? patientProfileAppBarModel.isInpatient - ? 160 - : patientProfileAppBarModel.isAppointmentHeader - ? 290 - : 170 - : patientProfileAppBarModel.height); -} diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 1a47dd00..8816ba84 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -14,56 +14,19 @@ import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { - final PatiantInformtion patient; - final double height; - final bool isInpatient; - final bool isDischargedPatient; - final bool isFromLiveCare; - - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final bool isPrescriptions; - final bool isMedicalFile; - final String episode; - final String visitDate; - final String clinic; - final bool isAppointmentHeader; - final bool isFromLabResult; - - PatientProfileAppBar( - this.patient, - {this.height = 0.0, - this.isInpatient = false, - this.isDischargedPatient = false, - this.isFromLiveCare = false, - this.doctorName, - this.branch, - this.appointmentDate, - this.profileUrl, - this.invoiceNO, - this.orderNo, - this.isPrescriptions = false, - this.clinic, - this.isMedicalFile = false, - this.episode, - this.visitDate, - this.isAppointmentHeader = false, - this.isFromLabResult = false}); + final PatientProfileAppBarModel patientProfileAppBarModel; + PatientProfileAppBar({this.patientProfileAppBarModel}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + if (patientProfileAppBarModel.patient.patientDetails != null) { + gender = patientProfileAppBarModel.patient.patientDetails.gender; } else { - gender = patient.gender; + gender = patientProfileAppBarModel.patient.gender; } return Container( @@ -75,13 +38,6 @@ class PatientProfileAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - // height: height == 0 - // ? isInpatient - // ? 215 - // : isAppointmentHeader - // ? 325 - // : 200 - // : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -97,11 +53,16 @@ class PatientProfileAppBar extends StatelessWidget ), Expanded( child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.fullName??patient.patientDetails.fullName), + patientProfileAppBarModel.patient.firstName != null + ? (Helpers.capitalize( + patientProfileAppBarModel.patient.firstName) + + " " + + Helpers.capitalize( + patientProfileAppBarModel.patient.lastName)) + : Helpers.capitalize( + patientProfileAppBarModel.patient.fullName ?? + patientProfileAppBarModel + .patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -110,18 +71,19 @@ class PatientProfileAppBar extends StatelessWidget ), gender == 1 ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) + DoctorApp.male_2, + color: Colors.blue, + ) : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), + DoctorApp.female_1, + color: Colors.pink, + ), Container( margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + + patientProfileAppBarModel.patient.mobileNumber); }, child: Icon( Icons.phone, @@ -152,21 +114,21 @@ class PatientProfileAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - patient.patientStatusType != null + patientProfileAppBarModel.patient.patientStatusType != null ? Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - patient.patientStatusType == 43 - ? AppText( - TranslationBase - .of(context) - .arrivedP, - color: Colors.green, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patientProfileAppBarModel + .patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) : AppText( TranslationBase.of(context).notArrived, color: Colors.red[800], @@ -174,10 +136,14 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - patient.startTime != null + patientProfileAppBarModel.patient.startTime != + null ? AppText( - patient.startTime != null - ? patient.startTime + patientProfileAppBarModel + .patient.startTime != + null + ? patientProfileAppBarModel + .patient.startTime : '', fontWeight: FontWeight.w700, fontSize: 12, @@ -197,46 +163,55 @@ class PatientProfileAppBar extends StatelessWidget color: Colors.black), children: [ new TextSpan( - text: TranslationBase - .of(context) - .fileNumber, - + text: TranslationBase.of(context).fileNumber, style: TextStyle( fontSize: 10, fontFamily: 'Poppins', color: Color(0xFF575757), fontWeight: FontWeight.w600, - - ),), + ), + ), new TextSpan( - text: patient.patientId.toString(), + text: patientProfileAppBarModel + .patient.patientId + .toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 12, color: Color(0xFF2E303A),)), + fontSize: 12, + color: Color(0xFF2E303A), + )), ], ), ), Row( children: [ AppText( - patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', + patientProfileAppBarModel.patient.nationalityName ?? + patientProfileAppBarModel + .patient.nationality ?? + patientProfileAppBarModel + .patient.nationalityId ?? + '', fontWeight: FontWeight.bold, fontSize: 12, ), - patient.nationalityFlagURL != null + patientProfileAppBarModel + .patient.nationalityFlagURL != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - patient.nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + patientProfileAppBarModel + .patient.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) : SizedBox() ], ) @@ -252,34 +227,34 @@ class PatientProfileAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase - .of(context) - .age + " : ", - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), + text: TranslationBase.of(context).age + " : ", + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + )), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday( - patient.patientDetails != null - ? patient.patientDetails.dateofBirth ?? - "" - : patient.dateofBirth ?? "", context, - isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient.patientDetails != null ? patientProfileAppBarModel.patient.patientDetails.dateofBirth ?? "" : patientProfileAppBarModel.patient.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12, - color: Color(0xFF2E303A),)), + color: Color(0xFF2E303A), + )), ], ), ), ), - if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty) + if (patientProfileAppBarModel.patient.appointmentDate != + null && + patientProfileAppBarModel + .patient.appointmentDate.isNotEmpty) Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate + " : ", fontSize: 10, color: Color(0xFF575757), fontWeight: FontWeight.w600, @@ -289,11 +264,10 @@ class PatientProfileAppBar extends StatelessWidget width: 3.5, ), AppText( - AppDateUtils - .getDayMonthYearDateFormatted( + AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( - patient.appointmentDate)) - , + patientProfileAppBarModel + .patient.appointmentDate)), fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -303,105 +277,109 @@ class PatientProfileAppBar extends StatelessWidget ) ], ), - if(isFromLabResult)Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + if (patientProfileAppBarModel.isFromLabResult) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: "Result Date: ", + style: TextStyle( + fontSize: 10, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + )), + new TextSpan( + text: + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 12)), + ], ), - children: [ - new TextSpan( - text: "Result Date: ", - style: TextStyle( fontSize: 10, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - fontFamily: 'Poppins',)), - new TextSpan( - text: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 12)), - ], ), ), - ), // if(isInpatient) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if(patient.admissionDate != null && patient.admissionDate.isNotEmpty) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (patientProfileAppBarModel.patient.admissionDate != + null && + patientProfileAppBarModel + .patient.admissionDate.isNotEmpty) Container( child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), fontFamily: 'Poppins', ), children: [ - new TextSpan( - text: patient.admissionDate == null - ? "" - : TranslationBase.of(context) + new TextSpan( + text: patientProfileAppBarModel + .patient.admissionDate == + null + ? "" + : TranslationBase.of(context) .admissionDate + - " : ", - style: TextStyle(fontSize: 10)), - new TextSpan( - text: patient.admissionDate == null - ? "" - : "${AppDateUtils - .getDayMonthYearDateFormatted( - (AppDateUtils - .getDateTimeFromServerFormat( - patient.admissionDate - .toString())))}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A),)), - ]))), - if (patient.admissionDate != null) - Row( - children: [ - AppText( + " : ", + style: TextStyle(fontSize: 10)), + new TextSpan( + text: patientProfileAppBarModel + .patient.admissionDate == + null + ? "" + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate.toString())))}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + )), + ]))), + if (patientProfileAppBarModel.patient.admissionDate != + null) + Row( + children: [ + AppText( "${TranslationBase.of(context).numOfDays}: ", - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757) + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757)), + if (patientProfileAppBarModel + .isDischargedPatient && + patientProfileAppBarModel + .patient.dischargeDate != + null) + AppText( + "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), + ) + else + AppText( + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + fontWeight: FontWeight.w700, + fontSize: 12, + color: Color(0xFF2E303A), ), - if(isDischargedPatient && - patient.dischargeDate != null) - AppText( - "${AppDateUtils - .getDateTimeFromServerFormat( - patient.dischargeDate) - .difference(AppDateUtils - .getDateTimeFromServerFormat( - patient.admissionDate)) - .inDays + 1}", - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - ) - else - AppText( - "${DateTime - .now() - .difference(AppDateUtils - .getDateTimeFromServerFormat( - patient.admissionDate)) - .inDays + 1}", - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A),), - ], - ), - ], - ), + ], + ), + ], + ), ], ), ), ]), - if(isAppointmentHeader) + if (patientProfileAppBarModel.isAppointmentHeader) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -415,10 +393,9 @@ class PatientProfileAppBar extends StatelessWidget decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom: BorderSide( - color: Colors.grey[400], width: 2.5), - left: BorderSide( - color: Colors.grey[400], width: 2.5), + bottom: + BorderSide(color: Colors.grey[400], width: 2.5), + left: BorderSide(color: Colors.grey[400], width: 2.5), )), ), Expanded( @@ -429,107 +406,151 @@ class PatientProfileAppBar extends StatelessWidget children: [ Container( child: LargeAvatar( - name: doctorName ?? "", - url: profileUrl, + name: patientProfileAppBarModel.doctorName ?? "", + url: patientProfileAppBarModel.profileUrl, ), width: 25, height: 25, margin: EdgeInsets.only(top: 10), ), - - Expanded( flex: 5, child: Container( margin: EdgeInsets.all(10), child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - '${TranslationBase - .of(context) - .dr}$doctorName', + '${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}', color: Color(0xFF2E303A), fontWeight: FontWeight.w700, fontSize: 12, ), - if (orderNo != null && - !isPrescriptions) + if (patientProfileAppBarModel.orderNo != + null && + !patientProfileAppBarModel + .isPrescriptions) Row( children: [ - AppText('Order No: ', - - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), - AppText(orderNo ?? '', + AppText( + 'Order No: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .orderNo ?? + '', fontSize: 12) ], ), - if (invoiceNO != null && - !isPrescriptions) + if (patientProfileAppBarModel.invoiceNO != + null && + !patientProfileAppBarModel + .isPrescriptions) Row( children: [ - AppText('Invoice: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), - AppText(invoiceNO ?? "", + AppText( + 'Invoice: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .invoiceNO ?? + "", fontSize: 12) ], ), - if (branch != null) + if (patientProfileAppBarModel.branch != + null) Row( children: [ - AppText('Branch: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), - AppText(branch ?? '', + AppText( + 'Branch: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .branch ?? + '', fontSize: 12) ], ), - - if (clinic != null) + if (patientProfileAppBarModel.clinic != + null) Row( children: [ - AppText('Clinic: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), - AppText(clinic ?? '', + AppText( + 'Clinic: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .clinic ?? + '', fontSize: 12) ], ), - if (isMedicalFile && - episode != null) + if (patientProfileAppBarModel + .isMedicalFile && + patientProfileAppBarModel.episode != + null) Row( children: [ - AppText('Episode: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), - AppText(episode ?? '', + AppText( + 'Episode: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .episode ?? + '', fontSize: 12) ], ), - if (isMedicalFile && - visitDate != null) + if (patientProfileAppBarModel + .isMedicalFile && + patientProfileAppBarModel.visitDate != + null) Row( children: [ - AppText('Visit Date: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), - AppText(visitDate ?? '', + AppText( + 'Visit Date: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ), + AppText( + patientProfileAppBarModel + .visitDate ?? + '', fontSize: 12) ], ), - if (!isMedicalFile) + if (!patientProfileAppBarModel + .isMedicalFile) Row( - children: [ AppText( - !isPrescriptions + !patientProfileAppBarModel + .isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), ), AppText( - '${AppDateUtils - .getDayMonthYearDateFormatted( - appointmentDate, - isArabic: projectViewModel - .isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', fontSize: 12, ) ], @@ -548,9 +569,15 @@ class PatientProfileAppBar extends StatelessWidget ), ); } + @override - Size get preferredSize => - Size(double.maxFinite, height == 0 - ? isInpatient ? 160 : isAppointmentHeader ? 290 : 170 - : height); + Size get preferredSize => Size( + double.maxFinite, + patientProfileAppBarModel.height == 0 + ? patientProfileAppBarModel.isInpatient + ? 160 + : patientProfileAppBarModel.isAppointmentHeader + ? 290 + : 170 + : patientProfileAppBarModel.height); } diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 9bd6ee02..382b71f6 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -4,7 +4,7 @@ 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/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar-copy.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -49,7 +49,7 @@ class AppScaffold extends StatelessWidget { child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, appBar: isShowAppBar - ? patientProfileAppBarModel != null ? PatientProfileAppBarCopy( + ? patientProfileAppBarModel != null ? PatientProfileAppBar( patientProfileAppBarModel: patientProfileAppBarModel,) : appBar ?? AppBar( elevation: 0, From 93287241676e0442c01e48fd14665b9bb2628f26 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 12:37:09 +0300 Subject: [PATCH 084/124] fix height patient app header --- .../profile_screen/patient_profile_screen.dart | 12 ++++++------ .../patients/profile/patient-profile-app-bar.dart | 14 +++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index e0a83857..70591d1f 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -108,12 +108,12 @@ class _PatientProfileScreenState extends State patient: patient, isFromLiveCare: isFromLiveCare, isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 220 - : isDischargedPatient - ? 240 - : 0, + // height: (patient.patientStatusType != null && + // patient.patientStatusType == 43) + // ? 220 + // : isDischargedPatient + // ? 240 + // : 0, isDischargedPatient: isDischargedPatient), ), Container( diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 8816ba84..8caf6754 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -574,10 +574,14 @@ class PatientProfileAppBar extends StatelessWidget Size get preferredSize => Size( double.maxFinite, patientProfileAppBarModel.height == 0 - ? patientProfileAppBarModel.isInpatient - ? 160 - : patientProfileAppBarModel.isAppointmentHeader - ? 290 - : 170 + ? patientProfileAppBarModel.isAppointmentHeader + ? 270 + : ((patientProfileAppBarModel.patient.appointmentDate != null &&patientProfileAppBarModel.patient.appointmentDate.isNotEmpty ) + ? patientProfileAppBarModel.isFromLabResult?170:150 + : patientProfileAppBarModel.patient.admissionDate != null + ? 150 + : patientProfileAppBarModel.isDischargedPatient + ? 240 + : 130) : patientProfileAppBarModel.height); } From 6fca263109ff61765d0660ce9341508993c08330 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 14 Jun 2021 14:05:14 +0300 Subject: [PATCH 085/124] video_streaming draggable popup --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 8 +- .../com/hmg/hmgDr/ui/VideoCallActivity.java | 30 +- .../hmgDr/ui/fragment/VideoCallFragment.kt | 290 ++++++++++++++++-- .../main/res/layout/activity_video_call.xml | 7 +- android/app/src/main/res/values/styles.xml | 17 + 5 files changed, 297 insertions(+), 55 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index b57f5732..f013d281 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -7,7 +7,7 @@ import androidx.annotation.NonNull import com.google.gson.GsonBuilder import com.hmg.hmgDr.Model.GetSessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel -import io.flutter.embedding.android.FlutterFragment +import com.hmg.hmgDr.ui.fragment.VideoCallFragment import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugin.common.MethodCall @@ -22,7 +22,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler private var call: MethodCall? = null private val LAUNCH_VIDEO: Int = 1 - private val flutterFragment: FlutterFragment? = null + lateinit var dialogFragment: VideoCallFragment override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine) @@ -78,7 +78,9 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler // startActivityForResult(intent, LAUNCH_VIDEO) val transaction = supportFragmentManager.beginTransaction() -// transaction.add() + dialogFragment = VideoCallFragment.newInstance(Bundle()) + dialogFragment.isCancelable = false + dialogFragment.show(transaction, "dialog") } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java index be4ebfb8..0fb061f1 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java @@ -411,10 +411,6 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi finish(); } - public void onMinimizedClicked(View view) { - - } - public void onSwitchCameraClicked(View view) { if (mPublisher != null) { isSwitchCameraClicked = !isSwitchCameraClicked; @@ -424,6 +420,14 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi } } + public void onCallClicked(View view) { + disconnectSession(); + } + + public void onMinimizedClicked(View view) { + + } + public void onCameraClicked(View view) { if (mPublisher != null) { isCameraClicked = !isCameraClicked; @@ -433,15 +437,6 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi } } - public void onSpeckerClicked(View view) { - if (mSubscriber != null) { - isSpeckerClicked = !isSpeckerClicked; - mSubscriber.setSubscribeToAudio(!isSpeckerClicked); - int res = isSpeckerClicked ? R.drawable.audio_disabled : R.drawable.audio_enabled; - mspeckerBtn.setImageResource(res); - } - } - public void onMicClicked(View view) { if (mPublisher != null) { @@ -452,8 +447,13 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi } } - public void onCallClicked(View view) { - disconnectSession(); + public void onSpeckerClicked(View view) { + if (mSubscriber != null) { + isSpeckerClicked = !isSpeckerClicked; + mSubscriber.setSubscribeToAudio(!isSpeckerClicked); + int res = isSpeckerClicked ? R.drawable.audio_disabled : R.drawable.audio_enabled; + mspeckerBtn.setImageResource(res); + } } @Override diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index be343b89..d5a5d5da 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -3,24 +3,26 @@ package com.hmg.hmgDr.ui.fragment import android.Manifest import android.annotation.SuppressLint import android.app.Activity +import android.app.Dialog +import android.content.Context import android.content.Intent +import android.graphics.Color +import android.graphics.Point +import android.graphics.drawable.ColorDrawable import android.opengl.GLSurfaceView import android.os.Bundle import android.os.CountDownTimer import android.os.Handler import android.os.Looper import android.util.Log -import android.view.LayoutInflater -import android.view.MotionEvent -import android.view.View -import android.view.ViewGroup +import android.view.* import android.widget.* -import androidx.fragment.app.Fragment +import androidx.annotation.Nullable +import androidx.fragment.app.DialogFragment import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel import com.hmg.hmgDr.Model.GetSessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.R -import com.hmg.hmgDr.ui.VideoCallActivity import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView import com.hmg.hmgDr.ui.VideoCallPresenterImpl @@ -31,10 +33,20 @@ import pub.devrel.easypermissions.AppSettingsDialog import pub.devrel.easypermissions.EasyPermissions import pub.devrel.easypermissions.EasyPermissions.PermissionCallbacks import java.util.* +import kotlin.math.ceil -class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListener, PublisherListener, +class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.SessionListener, PublisherListener, SubscriberKit.VideoListener, VideoCallView { + var isFullScreen: Boolean = true + private var x_init_cord = 0 + private var y_init_cord:Int = 0 + private var x_init_margin:Int = 0 + private var y_init_margin:Int = 0 + private val szWindow: Point = Point() + private lateinit var mWindowManager: WindowManager + private var isLeft = true + lateinit var videoCallPresenter: VideoCallPresenter private var mSession: Session? = null @@ -61,11 +73,13 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen private var isSpeckerClicked = false private var isMicClicked = false - private var mCallBtn: ImageView? = null - private var mCameraBtn: ImageView? = null - private var mSwitchCameraBtn: ImageView? = null - private var mspeckerBtn: ImageView? = null - private var mMicBtn: ImageView? = null + private lateinit var videoCallContainer: LinearLayout + private lateinit var mCallBtn: ImageView + private lateinit var btnMinimize: ImageView + private lateinit var mCameraBtn: ImageView + private lateinit var mSwitchCameraBtn: ImageView + private lateinit var mspeckerBtn: ImageView + private lateinit var mMicBtn: ImageView private val progressBar: ProgressBar? = null private val countDownTimer: CountDownTimer? = null @@ -84,6 +98,45 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen requestPermissions() } + override fun onStart() { + super.onStart() + + dialog?.window?.setLayout( + LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT + ) + } + + override fun getTheme(): Int { + return R.style.dialogTheme + } + + override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog { + val dialog: Dialog = super.onCreateDialog(savedInstanceState) + return dialog + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + // This is done in a post() since the dialog must be drawn before locating. + requireView().post { + val dialogWindow = dialog!!.window + + if (dialog != null && dialogWindow != null) { + dialogWindow.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)); + } + + // Make the dialog possible to be outside touch + dialogWindow!!.setFlags( + WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, + WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL + ) + dialogWindow.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND) + requireView().invalidate() + } + } + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { @@ -91,6 +144,7 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen Objects.requireNonNull(requireActivity().actionBar)!!.hide() initUI(view) + handleDragDialog() return view } @@ -121,6 +175,7 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen @SuppressLint("ClickableViewAccessibility") private fun initUI(view: View) { + videoCallContainer = view.findViewById(R.id.video_call_ll) mPublisherViewContainer = view.findViewById(R.id.local_video_view_container) mSubscriberViewContainer = view.findViewById(R.id.remote_video_view_container) @@ -136,11 +191,29 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen controlPanel = view.findViewById(R.id.control_panel) videoCallPresenter = VideoCallPresenterImpl(this, baseUrl) mCallBtn = view.findViewById(R.id.btn_call) + mCallBtn.setOnClickListener { + onCallClicked(it) + } + btnMinimize = view.findViewById(R.id.btn_minimize) + btnMinimize.setOnClickListener { + onMinimizedClicked(it) + } mCameraBtn = view.findViewById(R.id.btn_camera) + mCameraBtn.setOnClickListener { + onCameraClicked(it) + } mSwitchCameraBtn = view.findViewById(R.id.btn_switch_camera) + mSwitchCameraBtn.setOnClickListener { + onSwitchCameraClicked(it) + } mspeckerBtn = view.findViewById(R.id.btn_specker) + mspeckerBtn.setOnClickListener { + onSpeckerClicked(it) + } mMicBtn = view.findViewById(R.id.btn_mic) - + mMicBtn.setOnClickListener { + onMicClicked(it) + } // progressBarLayout=findViewById(R.id.progressBar); // progressBar=findViewById(R.id.progress_bar); // progressBarTextView=findViewById(R.id.progress_bar_text); @@ -316,6 +389,20 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen requireActivity().finish() } + + override fun onCallSuccessful(sessionStatusModel: SessionStatusModel) { + if (sessionStatusModel.sessionStatus == 2 || sessionStatusModel.sessionStatus == 3) { + val returnIntent = Intent() + returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel) + requireActivity().setResult(Activity.RESULT_OK, returnIntent) + requireActivity().finish() + } + } + + override fun onCallChangeCallStatusSuccessful(sessionStatusModel: SessionStatusModel?) {} + + override fun onFailure() {} + fun onSwitchCameraClicked(view: View?) { if (mPublisher != null) { isSwitchCameraClicked = !isSwitchCameraClicked @@ -325,6 +412,25 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen } } + fun onCallClicked(view: View?) { + disconnectSession() + } + + fun onMinimizedClicked(view: View?) { + if (isFullScreen) { + dialog?.window?.setLayout( + 400, + 600 + ) + } else { + dialog?.window?.setLayout( + LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT + ) + } + isFullScreen = !isFullScreen + } + fun onCameraClicked(view: View?) { if (mPublisher != null) { isCameraClicked = !isCameraClicked @@ -334,6 +440,15 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen } } + fun onMicClicked(view: View?) { + if (mPublisher != null) { + isMicClicked = !isMicClicked + mPublisher!!.publishAudio = !isMicClicked + val res = if (isMicClicked) R.drawable.mic_disabled else R.drawable.mic_enabled + mMicBtn!!.setImageResource(res) + } + } + fun onSpeckerClicked(view: View?) { if (mSubscriber != null) { isSpeckerClicked = !isSpeckerClicked @@ -343,31 +458,144 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen } } - fun onMicClicked(view: View?) { - if (mPublisher != null) { - isMicClicked = !isMicClicked - mPublisher!!.publishAudio = !isMicClicked - val res = if (isMicClicked) R.drawable.mic_disabled else R.drawable.mic_enabled - mMicBtn!!.setImageResource(res) + @SuppressLint("ClickableViewAccessibility") + fun handleDragDialog(){ + mWindowManager = requireActivity().getSystemService(Context.WINDOW_SERVICE) as WindowManager + getWindowManagerDefaultDisplay() + + videoCallContainer.setOnTouchListener { _, event -> + //Get Floating widget view params + //Get Floating widget view params + val layoutParams : WindowManager.LayoutParams = dialog!!.window!!.attributes + //get the touch location coordinates + val x_cord = event.rawX.toInt() + val y_cord = event.rawY.toInt() + val x_cord_Destination: Int + var y_cord_Destination: Int + + when (event.action) { + MotionEvent.ACTION_DOWN -> { + x_init_cord = x_cord + y_init_cord = y_cord + + //remember the initial position. + x_init_margin = layoutParams.x + y_init_margin = layoutParams.y + } + MotionEvent.ACTION_UP -> { + //Get the difference between initial coordinate and current coordinate + val x_diff: Int = x_cord - x_init_cord + val y_diff: Int = y_cord - y_init_cord + + y_cord_Destination = y_init_margin + y_diff + val barHeight: Int = getStatusBarHeight() + if (y_cord_Destination < 0) { +// y_cord_Destination = 0 + y_cord_Destination = + -(szWindow.y - (videoCallContainer.height /*+ barHeight*/)) + } else if (y_cord_Destination + (videoCallContainer.height + barHeight) > szWindow.y) { + y_cord_Destination = + szWindow.y - (videoCallContainer.height + barHeight) + } + layoutParams.y = y_cord_Destination + + //reset position if user drags the floating view + resetPosition(x_cord) + } + MotionEvent.ACTION_MOVE -> { + val x_diff_move: Int = x_cord - x_init_cord + val y_diff_move: Int = y_cord - y_init_cord + x_cord_Destination = x_init_margin + x_diff_move + y_cord_Destination = y_init_margin + y_diff_move + + layoutParams.x = x_cord_Destination + layoutParams.y = y_cord_Destination + + dialog!!.window!!.attributes = layoutParams + } + } + true } } - fun onCallClicked(view: View?) { - disconnectSession() + /* Reset position of Floating Widget view on dragging */ + private fun resetPosition(x_cord_now: Int) { + if (x_cord_now <= szWindow.x / 2) { + isLeft = true + moveToLeft(x_cord_now) + } else { + isLeft = false + moveToRight(x_cord_now) + } } - override fun onCallSuccessful(sessionStatusModel: SessionStatusModel) { - if (sessionStatusModel.sessionStatus == 2 || sessionStatusModel.sessionStatus == 3) { - val returnIntent = Intent() - returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel) - requireActivity().setResult(Activity.RESULT_OK, returnIntent) - requireActivity().finish() - } + /* Method to move the Floating widget view to Left */ + private fun moveToLeft(current_x_cord: Int) { + + var mParams : WindowManager.LayoutParams = dialog!!.window!!.attributes + + mParams.x = + (szWindow.x - current_x_cord * current_x_cord - videoCallContainer.width).toInt() + + dialog!!.window!!.attributes = mParams + val x = szWindow.x - current_x_cord + object : CountDownTimer(500, 5) { + //get params of Floating Widget view + var mParams : WindowManager.LayoutParams = dialog!!.window!!.attributes + override fun onTick(t: Long) { + val step = (500 - t) / 5 + // mParams.x = 0 - (current_x_cord * current_x_cord * step).toInt() + mParams.x = + (szWindow.x - current_x_cord * current_x_cord * step - videoCallContainer.width).toInt() + + dialog!!.window!!.attributes = mParams + } + + override fun onFinish() { + mParams.x = -(szWindow.x - videoCallContainer.width) + + dialog!!.window!!.attributes = mParams + } + }.start() } - override fun onCallChangeCallStatusSuccessful(sessionStatusModel: SessionStatusModel?) {} + /* Method to move the Floating widget view to Right */ + private fun moveToRight(current_x_cord: Int) { +// var mParams : WindowManager.LayoutParams = dialog!!.window!!.attributes +// mParams.x = +// (szWindow.x + current_x_cord * current_x_cord - videoCallContainer.width).toInt() +// +// dialog!!.window!!.attributes = mParams + object : CountDownTimer(500, 5) { + //get params of Floating Widget view + var mParams : WindowManager.LayoutParams = dialog!!.window!!.attributes + override fun onTick(t: Long) { + val step = (500 - t) / 5 + mParams.x = + (szWindow.x + current_x_cord * current_x_cord * step - videoCallContainer.width).toInt() + + dialog!!.window!!.attributes = mParams + } - override fun onFailure() {} + override fun onFinish() { + mParams.x = szWindow.x - videoCallContainer.width + + dialog!!.window!!.attributes = mParams + } + }.start() + } + + private fun getWindowManagerDefaultDisplay() { + mWindowManager.getDefaultDisplay() + .getSize(szWindow) + } + + /* return status bar height on basis of device display metrics */ + private fun getStatusBarHeight(): Int { + return ceil( + (25 * requireActivity().applicationContext.resources.displayMetrics.density).toDouble() + ).toInt() + } companion object { @JvmStatic @@ -376,7 +604,7 @@ class VideoCallFragment : Fragment(), PermissionCallbacks, Session.SessionListen arguments = args } - private val TAG = VideoCallActivity::class.java.simpleName + private val TAG = VideoCallFragment::class.java.simpleName private const val RC_SETTINGS_SCREEN_PERM = 123 private const val RC_VIDEO_APP_PERM = 124 diff --git a/android/app/src/main/res/layout/activity_video_call.xml b/android/app/src/main/res/layout/activity_video_call.xml index a3c2ced1..b7ca8d8d 100644 --- a/android/app/src/main/res/layout/activity_video_call.xml +++ b/android/app/src/main/res/layout/activity_video_call.xml @@ -1,6 +1,7 @@ @@ -132,7 +132,6 @@ android:layout_width="@dimen/video_icon_size" android:layout_height="@dimen/video_icon_size" android:layout_alignParentEnd="true" - android:onClick="onCallClicked" android:scaleType="centerCrop" android:src="@drawable/call" /> @@ -141,7 +140,6 @@ android:layout_width="@dimen/video_icon_size" android:layout_height="@dimen/video_icon_size" android:layout_alignParentStart="true" - android:onClick="onMinimizedClicked" android:layout_marginEnd="@dimen/padding_space_small" android:scaleType="centerCrop" android:src="@drawable/ic_mini" /> @@ -151,7 +149,6 @@ android:layout_width="@dimen/video_icon_size" android:layout_height="@dimen/video_icon_size" android:layout_toEndOf="@id/btn_minimize" - android:onClick="onCameraClicked" android:scaleType="centerCrop" android:layout_marginEnd="@dimen/padding_space_small" android:src="@drawable/video_enabled" /> @@ -161,7 +158,6 @@ android:layout_width="@dimen/video_icon_size" android:layout_height="@dimen/video_icon_size" android:layout_toEndOf="@id/btn_camera" - android:onClick="onMicClicked" android:layout_marginEnd="@dimen/padding_space_small" android:scaleType="centerCrop" android:src="@drawable/mic_enabled" /> @@ -171,7 +167,6 @@ android:layout_width="@dimen/video_icon_size" android:layout_height="@dimen/video_icon_size" android:layout_toEndOf="@id/btn_mic" - android:onClick="onSpeckerClicked" android:scaleType="centerCrop" android:layout_marginEnd="@dimen/padding_space_small" android:src="@drawable/audio_enabled" /> diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 24355fae..e13b5b14 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -16,4 +16,21 @@ true @null + + + From 148657e06bd04e01d3f5ab309fcf8de71599e858 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 15:23:37 +0300 Subject: [PATCH 086/124] small fix --- 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 8caf6754..5cfbe59c 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -579,7 +579,7 @@ class PatientProfileAppBar extends StatelessWidget : ((patientProfileAppBarModel.patient.appointmentDate != null &&patientProfileAppBarModel.patient.appointmentDate.isNotEmpty ) ? patientProfileAppBarModel.isFromLabResult?170:150 : patientProfileAppBarModel.patient.admissionDate != null - ? 150 + ? patientProfileAppBarModel.isFromLabResult?170:150 : patientProfileAppBarModel.isDischargedPatient ? 240 : 130) From 1edd375fd7002f8cd24e9f37ce918292fac4d5a9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 16:30:55 +0300 Subject: [PATCH 087/124] 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 088/124] 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 48874c0efdca0100d79638ae031fce14c5953c20 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Mon, 14 Jun 2021 17:27:21 +0300 Subject: [PATCH 089/124] no message --- ios/Runner/Base.lproj/Main.storyboard | 172 ++++++++++++----------- ios/Runner/MainAppViewController.swift | 78 +++++++--- ios/Runner/VideoCallViewController.swift | 59 ++++---- 3 files changed, 183 insertions(+), 126 deletions(-) diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index cecbd930..c1c16274 100755 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -39,79 +39,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - + @@ -128,7 +67,7 @@ - + @@ -261,7 +201,7 @@ - + @@ -270,11 +210,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -285,7 +293,10 @@ + + + @@ -294,17 +305,19 @@ + - + + @@ -333,7 +346,6 @@ - diff --git a/ios/Runner/MainAppViewController.swift b/ios/Runner/MainAppViewController.swift index 87610042..ffca444c 100644 --- a/ios/Runner/MainAppViewController.swift +++ b/ios/Runner/MainAppViewController.swift @@ -13,9 +13,10 @@ class MainAppViewController: FlutterViewController{ var videoCallContainer:AADraggableView! var videoCallViewController:VideoCallViewController! var videoCallFlutterResult:FlutterResult? - var vdoCallViewMinConstraint:[NSLayoutConstraint]! - var vdoCallViewMaxConstraint:[NSLayoutConstraint]! - + var vdoCallViewFloatRectConstraint:[NSLayoutConstraint]! + var vdoCallViewFullConstraint:[NSLayoutConstraint]! + var vdoCallViewFloatCircleConstraint:[NSLayoutConstraint]! + override func viewDidLoad() { super.viewDidLoad() @@ -58,15 +59,15 @@ extension MainAppViewController : ICallProtocol{ view.addSubview(videoCallContainer) setVideoViewConstrints() - NSLayoutConstraint.activate(vdoCallViewMaxConstraint) - NSLayoutConstraint.deactivate(vdoCallViewMinConstraint) + NSLayoutConstraint.activate(vdoCallViewFullConstraint) + NSLayoutConstraint.deactivate(vdoCallViewFloatRectConstraint) ViewEmbedder.embed( withIdentifier: "videoCall", // Storyboard ID parent: self, container: self.videoCallContainer){ vc in self.videoCallViewController = vc as? VideoCallViewController - + } } @@ -82,8 +83,17 @@ extension MainAppViewController : ICallProtocol{ if let arguments = call.arguments as? NSDictionary{ showVideoCallView(true) - videoCallViewController.onFloat = { min in - self.floatVideoCallView(min) + videoCallViewController.onRectFloat = { min in + self.rectFloatVideoCallView(min) + if(min){ + self.videoCallContainer.repositionIfNeeded() + } + } + + videoCallViewController.onCircleFloat = { min in + self.circleFloatVideoCallView(min) + self.videoCallContainer.reposition = min ? .free : .edgesOnly + self.videoCallContainer.repositionIfNeeded() } videoCallViewController.onCallConnect = { self.videoCallChannel?.invokeMethod("onCallConnected",arguments: nil) @@ -99,16 +109,18 @@ extension MainAppViewController : ICallProtocol{ } - private func floatVideoCallView(_ value:Bool){ + private func rectFloatVideoCallView(_ value:Bool){ videoCallContainer.enable(value) UIView.animate(withDuration: 0.5) { if(value){ - NSLayoutConstraint.deactivate(self.vdoCallViewMaxConstraint) - NSLayoutConstraint.activate(self.vdoCallViewMinConstraint) + NSLayoutConstraint.deactivate(self.vdoCallViewFullConstraint) + NSLayoutConstraint.deactivate(self.vdoCallViewFloatCircleConstraint) + NSLayoutConstraint.activate(self.vdoCallViewFloatRectConstraint) }else{ - NSLayoutConstraint.deactivate(self.vdoCallViewMinConstraint) - NSLayoutConstraint.activate(self.vdoCallViewMaxConstraint) + NSLayoutConstraint.deactivate(self.vdoCallViewFloatRectConstraint) + NSLayoutConstraint.deactivate(self.vdoCallViewFloatCircleConstraint) + NSLayoutConstraint.activate(self.vdoCallViewFullConstraint) } self.videoCallContainer.layer.cornerRadius = value ? 10 : 0 self.videoCallContainer.layer.borderColor = value ? UIColor.white.cgColor : nil @@ -117,6 +129,28 @@ extension MainAppViewController : ICallProtocol{ } } + private func circleFloatVideoCallView(_ value:Bool){ + videoCallContainer.enable(value) + + UIView.animate(withDuration: 0.5) { + if(value){ + NSLayoutConstraint.deactivate(self.vdoCallViewFullConstraint) + NSLayoutConstraint.deactivate(self.vdoCallViewFloatRectConstraint) + NSLayoutConstraint.activate(self.vdoCallViewFloatCircleConstraint) + self.videoCallContainer.layer.cornerRadius = 35 + }else{ + NSLayoutConstraint.activate(self.vdoCallViewFloatRectConstraint) + NSLayoutConstraint.deactivate(self.vdoCallViewFullConstraint) + NSLayoutConstraint.deactivate(self.vdoCallViewFloatCircleConstraint) + self.videoCallContainer.layer.cornerRadius = 10 + + } + self.videoCallContainer.layer.borderColor = value ? UIColor.white.cgColor : nil + self.videoCallContainer.layer.borderWidth = value ? 2 : 0 + self.view.layoutIfNeeded() + } + } + private func showVideoCallView(_ value:Bool){ UIView.animate(withDuration: 0.5) { self.videoCallContainer.isHidden = !value @@ -133,21 +167,31 @@ extension MainAppViewController : ICallProtocol{ func setVideoViewConstrints(){ + videoCallContainer.layer.shadowColor = UIColor.black.cgColor + videoCallContainer.layer.shadowOffset = CGSize(width: 1, height: 1) + videoCallContainer.layer.shadowRadius = 5 + let screen = UIScreen.main.bounds videoCallContainer.translatesAutoresizingMaskIntoConstraints = false - vdoCallViewMinConstraint = [ + vdoCallViewFullConstraint = [ + videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor), + videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor), + videoCallContainer.widthAnchor.constraint(equalToConstant: screen.width), + videoCallContainer.heightAnchor.constraint(equalToConstant: screen.height) + ] + vdoCallViewFloatRectConstraint = [ videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor, constant: 20), videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20), videoCallContainer.widthAnchor.constraint(equalToConstant: screen.width/3), videoCallContainer.heightAnchor.constraint(equalToConstant: screen.height/3.5) ] - vdoCallViewMaxConstraint = [ + vdoCallViewFloatCircleConstraint = [ videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor), videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor), - videoCallContainer.widthAnchor.constraint(equalToConstant: screen.width), - videoCallContainer.heightAnchor.constraint(equalToConstant: screen.height) + videoCallContainer.widthAnchor.constraint(equalToConstant: 70), + videoCallContainer.heightAnchor.constraint(equalToConstant: 70) ] } diff --git a/ios/Runner/VideoCallViewController.swift b/ios/Runner/VideoCallViewController.swift index 27268128..02a70a0c 100644 --- a/ios/Runner/VideoCallViewController.swift +++ b/ios/Runner/VideoCallViewController.swift @@ -34,8 +34,8 @@ class VideoCallViewController: UIViewController { var seconds = 30 var isUserConnect : Bool = false - var onFloat:((Bool)->Void)? = nil - var onMinimize:(()->Void)? = nil + var onRectFloat:((Bool)->Void)? = nil + var onCircleFloat:((Bool)->Void)? = nil var onCallConnect:(()->Void)? = nil var onCallDisconnect:(()->Void)? = nil @@ -50,13 +50,15 @@ class VideoCallViewController: UIViewController { @IBOutlet var minimizeConstraint: [NSLayoutConstraint]! @IBOutlet var maximisedConstraint: [NSLayoutConstraint]! + @IBOutlet weak var btnMinimize: UIButton! @IBOutlet weak var hideVideoBtn: UIButton! - @IBOutlet weak var draggableBoundryDefiner: UIView! var localVideoDraggable:AADraggableView? @IBOutlet weak var controlButtons: UIView! @IBOutlet weak var remoteVideoMutedIndicator: UIImageView! @IBOutlet weak var localVideoMutedBg: UIView! + @IBOutlet weak var localVideoContainer: UIView! + @IBOutlet weak var topBar: UIView! @IBOutlet weak var lblCallDuration: UILabel! @IBOutlet weak var remoteVideo: UIView! @IBOutlet weak var localVideo: UIView!{ @@ -69,18 +71,31 @@ class VideoCallViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - localVideoDraggable?.respectedView = draggableBoundryDefiner + localVideoDraggable?.respectedView = localVideoContainer } + @objc func click(gesture:UIGestureRecognizer){ + gesture.view?.removeFromSuperview() + } + + @IBAction func onVideoContainerTapped(_ sender: Any) { + if(hideVideoBtn.isSelected){ + circleFloatBtnTapped(hideVideoBtn) + + }else if(btnMinimize.isSelected){ + btnMinimizeTapped(btnMinimize) + }else if(!btnMinimize.isSelected){ + // Swipe video here + } + } @IBAction func didClickMuteButton(_ sender: UIButton) { sender.isSelected = !sender.isSelected publisher!.publishAudio = !sender.isSelected } - @IBAction func didClickSpeakerButton(_ sender: UIButton) { + @IBAction func didClickSpeakerButton(_ sender: UIButton) { sender.isSelected = !sender.isSelected subscriber?.subscribeToAudio = !sender.isSelected - // resetHideButtonsTimer() } @IBAction func didClickVideoMuteButton(_ sender: UIButton) { @@ -92,7 +107,6 @@ class VideoCallViewController: UIViewController { } localVideo.isHidden = sender.isSelected localVideoMutedBg.isHidden = !sender.isSelected - // resetHideButtonsTimer() } @@ -104,7 +118,6 @@ class VideoCallViewController: UIViewController { } else { publisher!.cameraPosition = AVCaptureDevice.Position.back } - /// resetHideButtonsTimer() } @IBAction func hangUp(_ sender: UIButton) { @@ -112,14 +125,19 @@ class VideoCallViewController: UIViewController { sessionDisconnect() } - @IBAction func hideVideoBtnTapped(_ sender: Any) { - onMinimize?() + @IBAction func circleFloatBtnTapped(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + onCircleFloat?(sender.isSelected) + topBar.isHidden = sender.isSelected + controlButtons.isHidden = sender.isSelected + localVideo.isHidden = sender.isSelected + self.publisher?.view?.layoutIfNeeded() } var floated = false - @IBAction func onMinimize(_ sender: UIButton) { + @IBAction func btnMinimizeTapped(_ sender: UIButton) { floated = !floated - onFloat?(floated) + onRectFloat?(floated) sender.isSelected = floated NSLayoutConstraint.activate(floated ? minimizeConstraint : maximisedConstraint) @@ -171,7 +189,6 @@ class VideoCallViewController: UIViewController { self.DoctorId = params.doctorId ?? 0 self.baseUrl = params.baseUrl ?? "" - setupButtons() askForMicrophonePermission() requestCameraPermissionsIfNeeded() hideVideoMuted() @@ -238,13 +255,6 @@ class VideoCallViewController: UIViewController { } } - - func setupButtons() { - perform(#selector(hideControlButtons), with: nil, afterDelay: 3) - let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(remoteVideoTapped(_:))) - view.addGestureRecognizer(tapGestureRecognizer) - view.isUserInteractionEnabled = true - } // MARK: -Microphone Camera and Permission Request func askForMicrophonePermission() { @@ -481,12 +491,6 @@ extension VideoCallViewController: OTPublisherDelegate { func publisher(_ publisher: OTPublisherKit, didFailWithError error: OTError) { print("The publisher failed: \(error)") } - @objc func remoteVideoTapped(_ recognizer: UITapGestureRecognizer?) { - if controlButtons.isHidden { - controlButtons.isHidden = false - perform(#selector(hideControlButtons), with: nil, afterDelay: 3) - } - } } extension VideoCallViewController: OTSubscriberDelegate { @@ -497,8 +501,5 @@ extension VideoCallViewController: OTSubscriberDelegate { public func subscriber(_ subscriber: OTSubscriberKit, didFailWithError error: OTError) { print("The subscriber failed to connect to the stream.") } - @objc func hideControlButtons() { -// controlButtons.isHidden = true - } } From 363b55069faf22e4696ebf875f256caf0bca563c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 18:04:20 +0300 Subject: [PATCH 090/124] 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 091/124] 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 092/124] 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 093/124] 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 094/124] 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 883778d27813700ff6aaa82ffaf5bb95f813ab2e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 15 Jun 2021 12:17:24 +0300 Subject: [PATCH 095/124] video call --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 41 ++- .../hmg/hmgDr/ui/VideoCallResponseListener.kt | 8 + .../hmgDr/ui/fragment/VideoCallFragment.kt | 310 +++++++++++++----- .../main/res/drawable/layout_rounded_bg.xml | 7 + .../main/res/layout/activity_video_call.xml | 96 +++--- android/app/src/main/res/values/dimens.xml | 8 +- .../viewModel/authentication_view_model.dart | 4 +- .../patient_profile_screen.dart | 1 + ...ent-profile-header-new-design-app-bar.dart | 21 +- 9 files changed, 359 insertions(+), 137 deletions(-) create mode 100644 android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt create mode 100644 android/app/src/main/res/drawable/layout_rounded_bg.xml diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index f013d281..d595be97 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -7,6 +7,7 @@ import androidx.annotation.NonNull import com.google.gson.GsonBuilder import com.hmg.hmgDr.Model.GetSessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel +import com.hmg.hmgDr.ui.VideoCallResponseListener import com.hmg.hmgDr.ui.fragment.VideoCallFragment import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine @@ -15,7 +16,7 @@ import io.flutter.plugin.common.MethodChannel import io.flutter.plugins.GeneratedPluginRegistrant -class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler { +class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, VideoCallResponseListener { private val CHANNEL = "Dr.cloudSolution/videoCall" private var result: MethodChannel.Result? = null @@ -67,7 +68,6 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler private fun openVideoCall(apiKey: String?, sessionId: String?, token: String?, appLang: String?, baseUrl: String?, sessionStatusModel: GetSessionStatusModel) { // val videoCallActivity = VideoCallActivity() - // val intent = Intent(this, VideoCallActivity::class.java) // intent.putExtra("apiKey", apiKey) // intent.putExtra("sessionId", sessionId) @@ -77,14 +77,23 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler // intent.putExtra("sessionStatusModel", sessionStatusModel) // startActivityForResult(intent, LAUNCH_VIDEO) + val arguments = Bundle() + arguments.putString("apiKey", apiKey) + arguments.putString("sessionId", sessionId) + arguments.putString("token", token) + arguments.putString("appLang", appLang) + arguments.putString("baseUrl", baseUrl) + arguments.putParcelable("sessionStatusModel", sessionStatusModel) + val transaction = supportFragmentManager.beginTransaction() - dialogFragment = VideoCallFragment.newInstance(Bundle()) - dialogFragment.isCancelable = false + dialogFragment = VideoCallFragment.newInstance(arguments) + dialogFragment.setCallListener(this) + dialogFragment.isCancelable = true dialogFragment.show(transaction, "dialog") } - override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + /* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) var asd = ""; if (requestCode == LAUNCH_VIDEO) { @@ -108,6 +117,28 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler result?.success(callResponse) } } + }*/ + + override fun onCallFinished(resultCode: Int, intent: Intent?) { + if (resultCode == Activity.RESULT_OK) { + val result : SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond") + val callResponse : HashMap = HashMap() + + val sessionStatus : HashMap = HashMap() + val gson = GsonBuilder().serializeNulls().create() + + callResponse["callResponse"] = "CallNotRespond" + val jsonRes = gson.toJson(result) + callResponse["sessionStatus"] = jsonRes + + this.result?.success(callResponse) + } + if (resultCode == Activity.RESULT_CANCELED) { + val callResponse : HashMap = HashMap() + callResponse["callResponse"] = "CallEnd" + + result?.success(callResponse) + } } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt new file mode 100644 index 00000000..e32630b4 --- /dev/null +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt @@ -0,0 +1,8 @@ +package com.hmg.hmgDr.ui + +import android.content.Intent + +interface VideoCallResponseListener { + + fun onCallFinished(resultCode : Int, intent: Intent? = null) +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index d5a5d5da..dd4613bd 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -10,39 +10,38 @@ import android.graphics.Color import android.graphics.Point import android.graphics.drawable.ColorDrawable import android.opengl.GLSurfaceView -import android.os.Bundle -import android.os.CountDownTimer -import android.os.Handler -import android.os.Looper +import android.os.* import android.util.Log import android.view.* import android.widget.* import androidx.annotation.Nullable +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.constraintlayout.widget.ConstraintSet import androidx.fragment.app.DialogFragment -import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel import com.hmg.hmgDr.Model.GetSessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.R import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView import com.hmg.hmgDr.ui.VideoCallPresenterImpl +import com.hmg.hmgDr.ui.VideoCallResponseListener import com.opentok.android.* import com.opentok.android.PublisherKit.PublisherListener import pub.devrel.easypermissions.AfterPermissionGranted import pub.devrel.easypermissions.AppSettingsDialog import pub.devrel.easypermissions.EasyPermissions import pub.devrel.easypermissions.EasyPermissions.PermissionCallbacks -import java.util.* import kotlin.math.ceil + class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.SessionListener, PublisherListener, SubscriberKit.VideoListener, VideoCallView { var isFullScreen: Boolean = true private var x_init_cord = 0 - private var y_init_cord:Int = 0 - private var x_init_margin:Int = 0 - private var y_init_margin:Int = 0 + private var y_init_cord: Int = 0 + private var x_init_margin: Int = 0 + private var y_init_margin: Int = 0 private val szWindow: Point = Point() private lateinit var mWindowManager: WindowManager private var isLeft = true @@ -58,9 +57,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private var mVolRunnable: Runnable? = null private var mConnectedRunnable: Runnable? = null - private var mPublisherViewContainer: FrameLayout? = null - private var mSubscriberViewContainer: RelativeLayout? = null - private var controlPanel: RelativeLayout? = null + private lateinit var mPublisherViewContainer: FrameLayout + private lateinit var mPublisherViewIcon: View + private lateinit var mSubscriberViewContainer: FrameLayout + private lateinit var mSubscriberViewIcon: ImageView + private var controlPanel: ConstraintLayout? = null private var apiKey: String? = null private var sessionId: String? = null @@ -73,7 +74,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private var isSpeckerClicked = false private var isMicClicked = false - private lateinit var videoCallContainer: LinearLayout + private lateinit var parentView: View + private lateinit var videoCallContainer: ConstraintLayout + private lateinit var layoutName: RelativeLayout private lateinit var mCallBtn: ImageView private lateinit var btnMinimize: ImageView private lateinit var mCameraBtn: ImageView @@ -81,6 +84,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private lateinit var mspeckerBtn: ImageView private lateinit var mMicBtn: ImageView + private lateinit var patientName: TextView + private lateinit var cmTimer: Chronometer + var elapsedTime: Long = 0 + var resume = false + private val progressBar: ProgressBar? = null private val countDownTimer: CountDownTimer? = null private val progressBarTextView: TextView? = null @@ -89,6 +97,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private var isConnected = false private var sessionStatusModel: GetSessionStatusModel? = null + private var videoCallResponseListener: VideoCallResponseListener? =null override fun onCreate(savedInstanceState: Bundle?) { @@ -137,16 +146,20 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } } + fun setCallListener(videoCallResponseListener: VideoCallResponseListener){ + this.videoCallResponseListener = videoCallResponseListener + } + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - val view = inflater.inflate(R.layout.activity_video_call, container, false) + parentView = inflater.inflate(R.layout.activity_video_call, container, false) - Objects.requireNonNull(requireActivity().actionBar)!!.hide() - initUI(view) +// Objects.requireNonNull(requireActivity().actionBar)!!.hide() + initUI(parentView) handleDragDialog() - return view + return parentView } override fun onPause() { @@ -170,14 +183,18 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onDestroy() { disconnectSession() + cmTimer.stop() super.onDestroy() } @SuppressLint("ClickableViewAccessibility") private fun initUI(view: View) { - videoCallContainer = view.findViewById(R.id.video_call_ll) - mPublisherViewContainer = view.findViewById(R.id.local_video_view_container) - mSubscriberViewContainer = view.findViewById(R.id.remote_video_view_container) + videoCallContainer = view.findViewById(R.id.video_call_ll) + layoutName = view.findViewById(R.id.layout_name) + mPublisherViewContainer = view.findViewById(R.id.local_video_view_container) + mPublisherViewIcon = view.findViewById(R.id.local_video_view_icon) + mSubscriberViewIcon = view.findViewById(R.id.remote_video_view_icon) + mSubscriberViewContainer = view.findViewById(R.id.remote_video_view_container) arguments?.run { apiKey = getString("apiKey") @@ -188,7 +205,27 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session sessionStatusModel = getParcelable("sessionStatusModel") } - controlPanel = view.findViewById(R.id.control_panel) + patientName = view.findViewById(R.id.patient_name) + patientName.text = sessionStatusModel!!.patientName + + cmTimer = view.findViewById(R.id.cmTimer) + cmTimer.format = "mm:ss" + cmTimer.onChronometerTickListener = Chronometer.OnChronometerTickListener { arg0: Chronometer? -> + val minutes: Long + val seconds: Long + if (!resume) { + minutes = (SystemClock.elapsedRealtime() - cmTimer.base) / 1000 / 60 + seconds = (SystemClock.elapsedRealtime() - cmTimer.base) / 1000 % 60 + elapsedTime = SystemClock.elapsedRealtime() + } else { + minutes = (elapsedTime - cmTimer.base) / 1000 / 60 + seconds = (elapsedTime - cmTimer.base) / 1000 % 60 + elapsedTime = elapsedTime + 1000 + } + Log.d(VideoCallFragment.TAG, "onChronometerTick: $minutes : $seconds") + } + + controlPanel = view.findViewById(R.id.control_panel) videoCallPresenter = VideoCallPresenterImpl(this, baseUrl) mCallBtn = view.findViewById(R.id.btn_call) mCallBtn.setOnClickListener { @@ -295,17 +332,23 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session (mPublisher!!.getView() as GLSurfaceView).setZOrderOnTop(true) } mSession!!.publish(mPublisher) + + if (!resume) { + cmTimer.base = SystemClock.elapsedRealtime() + } + cmTimer.start() } override fun onDisconnected(session: Session) { Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId) mSession = null + cmTimer.stop() } override fun onError(session: Session, opentokError: OpentokError) { Log.d(TAG, "onError: Error (" + opentokError.message + ") in session " + session.sessionId) - Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() - requireActivity().finish() +// Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() +// requireActivity().finish() } override fun onStreamReceived(session: Session, stream: Stream) { @@ -316,7 +359,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } isConnected = true subscribeToStream(stream) - videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) +// videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) } override fun onStreamDropped(session: Session, stream: Stream) { @@ -342,8 +385,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(publisherKit: PublisherKit?, opentokError: OpentokError) { Log.d(VideoCallFragment.TAG, "onError: Error (" + opentokError.message + ") in publisher") - Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() - requireActivity().finish() +// Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() +// requireActivity().finish() } override fun onVideoDataReceived(subscriberKit: SubscriberKit?) { @@ -367,8 +410,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private fun disconnectSession() { if (mSession == null) { - requireActivity().setResult(Activity.RESULT_CANCELED) - requireActivity().finish() + videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED) +// requireActivity().setResult(Activity.RESULT_CANCELED) + dialog?.dismiss() return } if (mSubscriber != null) { @@ -385,8 +429,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } mSession!!.disconnect() countDownTimer?.cancel() - videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) - requireActivity().finish() +// videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) + dialog?.dismiss() } @@ -394,8 +438,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session if (sessionStatusModel.sessionStatus == 2 || sessionStatusModel.sessionStatus == 3) { val returnIntent = Intent() returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel) - requireActivity().setResult(Activity.RESULT_OK, returnIntent) - requireActivity().finish() + videoCallResponseListener?.onCallFinished(Activity.RESULT_OK, returnIntent) +// requireActivity().setResult(Activity.RESULT_OK, returnIntent) + dialog?.dismiss() } } @@ -403,7 +448,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onFailure() {} - fun onSwitchCameraClicked(view: View?) { + private fun onSwitchCameraClicked(view: View?) { if (mPublisher != null) { isSwitchCameraClicked = !isSwitchCameraClicked mPublisher!!.cycleCamera() @@ -412,11 +457,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } } - fun onCallClicked(view: View?) { + private fun onCallClicked(view: View?) { disconnectSession() } - fun onMinimizedClicked(view: View?) { + private fun onMinimizedClicked(view: View?) { if (isFullScreen) { dialog?.window?.setLayout( 400, @@ -429,9 +474,89 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session ) } isFullScreen = !isFullScreen + setViewsVisibility() + } + + private fun setViewsVisibility() { + initUI(parentView) + val iconSize : Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt() + val iconSizeSmall : Int = context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt() + val btnMinimizeLayoutParam : ConstraintLayout.LayoutParams = btnMinimize.layoutParams as ConstraintLayout.LayoutParams + val mCallBtnLayoutParam : ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams + +// val localPreviewMargin : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() +// val localPreviewWidth : Int = context!!.resources.getDimension(R.dimen.local_preview_width).toInt() +// val localPreviewHeight : Int = context!!.resources.getDimension(R.dimen.local_preview_height).toInt() +// val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt() +// val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt() +// val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt() +// val localPreviewHeightSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_height_small).toInt() +// val localPreviewIconSmall: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size_small).toInt() +// val localPreviewLayoutIconParam : FrameLayout.LayoutParams +// val localPreviewLayoutParam : RelativeLayout.LayoutParams = mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams + + val remotePreviewIconSize: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt() + val remotePreviewIconSizeSmall: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() + val remotePreviewLayoutParam : FrameLayout.LayoutParams = mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams + + val constraintSet = ConstraintSet() + //layoutParam.constrain +// constraintSet. + if (isFullScreen) { + layoutName.visibility = View.VISIBLE + mCameraBtn.visibility = View.VISIBLE + mSwitchCameraBtn.visibility = View.VISIBLE + mspeckerBtn.visibility = View.VISIBLE + mMicBtn.visibility = View.VISIBLE + mPublisherViewContainer.visibility = View.VISIBLE + +// layoutParam = ConstraintLayout.LayoutParams(iconSize, iconSize) + btnMinimizeLayoutParam.width = iconSize + btnMinimizeLayoutParam.height = iconSize + mCallBtnLayoutParam.width = iconSize + mCallBtnLayoutParam.height = iconSize +// localPreviewLayoutIconParam = FrameLayout.LayoutParams(localPreviewIconSize, localPreviewIconSize) +//// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidth, localPreviewHeight) +// localPreviewLayoutParam.width = localPreviewIconSize +// localPreviewLayoutParam.height = localPreviewIconSize +// localPreviewLayoutParam.setMargins(0,localPreviewMargin, localPreviewMargin, 0) +// remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSize, remotePreviewIconSize) + remotePreviewLayoutParam.width = remotePreviewIconSize + remotePreviewLayoutParam.height = remotePreviewIconSize + } else { + layoutName.visibility = View.GONE + mCameraBtn.visibility = View.GONE + mSwitchCameraBtn.visibility = View.GONE + mspeckerBtn.visibility = View.GONE + mMicBtn.visibility = View.GONE + mPublisherViewContainer.visibility = View.GONE + +// layoutParam = ConstraintLayout.LayoutParams(iconSizeSmall, iconSizeSmall) + btnMinimizeLayoutParam.width = iconSizeSmall + btnMinimizeLayoutParam.height = iconSizeSmall + mCallBtnLayoutParam.width = iconSizeSmall + mCallBtnLayoutParam.height = iconSizeSmall + +// localPreviewLayoutIconParam = FrameLayout.LayoutParams(localPreviewIconSmall, localPreviewIconSmall) +//// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidthSmall, localPreviewHeightSmall) +// localPreviewLayoutParam.width = localPreviewWidthSmall +// localPreviewLayoutParam.height = localPreviewWidthSmall +// localPreviewLayoutParam.setMargins(0,localPreviewMarginSmall, localPreviewMarginSmall, 0) +// remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSizeSmall, remotePreviewIconSizeSmall) + remotePreviewLayoutParam.width = remotePreviewIconSizeSmall + remotePreviewLayoutParam.height = remotePreviewIconSizeSmall + } + +// mPublisherViewContainer.layoutParams = localPreviewLayoutParam +// mPublisherViewIcon.layoutParams = localPreviewLayoutIconParam + mSubscriberViewIcon.layoutParams = remotePreviewLayoutParam + + btnMinimize.layoutParams = btnMinimizeLayoutParam + mCallBtn.layoutParams = mCallBtnLayoutParam + } - fun onCameraClicked(view: View?) { + private fun onCameraClicked(view: View?) { if (mPublisher != null) { isCameraClicked = !isCameraClicked mPublisher!!.publishVideo = !isCameraClicked @@ -440,7 +565,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } } - fun onMicClicked(view: View?) { + private fun onMicClicked(view: View?) { if (mPublisher != null) { isMicClicked = !isMicClicked mPublisher!!.publishAudio = !isMicClicked @@ -449,7 +574,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } } - fun onSpeckerClicked(view: View?) { + private fun onSpeckerClicked(view: View?) { if (mSubscriber != null) { isSpeckerClicked = !isSpeckerClicked mSubscriber!!.subscribeToAudio = !isSpeckerClicked @@ -458,64 +583,69 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } } + @SuppressLint("ClickableViewAccessibility") - fun handleDragDialog(){ + fun handleDragDialog() { mWindowManager = requireActivity().getSystemService(Context.WINDOW_SERVICE) as WindowManager getWindowManagerDefaultDisplay() - videoCallContainer.setOnTouchListener { _, event -> - //Get Floating widget view params - //Get Floating widget view params - val layoutParams : WindowManager.LayoutParams = dialog!!.window!!.attributes - //get the touch location coordinates - val x_cord = event.rawX.toInt() - val y_cord = event.rawY.toInt() - val x_cord_Destination: Int - var y_cord_Destination: Int - - when (event.action) { - MotionEvent.ACTION_DOWN -> { - x_init_cord = x_cord - y_init_cord = y_cord - - //remember the initial position. - x_init_margin = layoutParams.x - y_init_margin = layoutParams.y - } - MotionEvent.ACTION_UP -> { - //Get the difference between initial coordinate and current coordinate - val x_diff: Int = x_cord - x_init_cord - val y_diff: Int = y_cord - y_init_cord - - y_cord_Destination = y_init_margin + y_diff - val barHeight: Int = getStatusBarHeight() - if (y_cord_Destination < 0) { + videoCallContainer.setOnTouchListener(dragListener) +// mSubscriberViewContainer.setOnTouchListener(dragListener) + } + + @SuppressLint("ClickableViewAccessibility") + val dragListener : View.OnTouchListener = View.OnTouchListener{ _, event -> + //Get Floating widget view params + //Get Floating widget view params + val layoutParams: WindowManager.LayoutParams = dialog!!.window!!.attributes + //get the touch location coordinates + val x_cord = event.rawX.toInt() + val y_cord = event.rawY.toInt() + val x_cord_Destination: Int + var y_cord_Destination: Int + + when (event.action) { + MotionEvent.ACTION_DOWN -> { + x_init_cord = x_cord + y_init_cord = y_cord + + //remember the initial position. + x_init_margin = layoutParams.x + y_init_margin = layoutParams.y + } + MotionEvent.ACTION_UP -> { + //Get the difference between initial coordinate and current coordinate + val x_diff: Int = x_cord - x_init_cord + val y_diff: Int = y_cord - y_init_cord + + y_cord_Destination = y_init_margin + y_diff + val barHeight: Int = getStatusBarHeight() + if (y_cord_Destination < 0) { // y_cord_Destination = 0 - y_cord_Destination = - -(szWindow.y - (videoCallContainer.height /*+ barHeight*/)) - } else if (y_cord_Destination + (videoCallContainer.height + barHeight) > szWindow.y) { - y_cord_Destination = - szWindow.y - (videoCallContainer.height + barHeight) - } - layoutParams.y = y_cord_Destination - - //reset position if user drags the floating view - resetPosition(x_cord) + y_cord_Destination = + -(szWindow.y - (videoCallContainer.height /*+ barHeight*/)) + } else if (y_cord_Destination + (videoCallContainer.height + barHeight) > szWindow.y) { + y_cord_Destination = + szWindow.y - (videoCallContainer.height + barHeight) } - MotionEvent.ACTION_MOVE -> { - val x_diff_move: Int = x_cord - x_init_cord - val y_diff_move: Int = y_cord - y_init_cord - x_cord_Destination = x_init_margin + x_diff_move - y_cord_Destination = y_init_margin + y_diff_move + layoutParams.y = y_cord_Destination + + //reset position if user drags the floating view + resetPosition(x_cord) + } + MotionEvent.ACTION_MOVE -> { + val x_diff_move: Int = x_cord - x_init_cord + val y_diff_move: Int = y_cord - y_init_cord + x_cord_Destination = x_init_margin + x_diff_move + y_cord_Destination = y_init_margin + y_diff_move - layoutParams.x = x_cord_Destination - layoutParams.y = y_cord_Destination + layoutParams.x = x_cord_Destination + layoutParams.y = y_cord_Destination - dialog!!.window!!.attributes = layoutParams - } + dialog!!.window!!.attributes = layoutParams } - true } + true } /* Reset position of Floating Widget view on dragging */ @@ -532,16 +662,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session /* Method to move the Floating widget view to Left */ private fun moveToLeft(current_x_cord: Int) { - var mParams : WindowManager.LayoutParams = dialog!!.window!!.attributes + var mParams: WindowManager.LayoutParams = dialog!!.window!!.attributes mParams.x = - (szWindow.x - current_x_cord * current_x_cord - videoCallContainer.width).toInt() + (szWindow.x - current_x_cord * current_x_cord - videoCallContainer.width).toInt() dialog!!.window!!.attributes = mParams val x = szWindow.x - current_x_cord object : CountDownTimer(500, 5) { //get params of Floating Widget view - var mParams : WindowManager.LayoutParams = dialog!!.window!!.attributes + var mParams: WindowManager.LayoutParams = dialog!!.window!!.attributes override fun onTick(t: Long) { val step = (500 - t) / 5 // mParams.x = 0 - (current_x_cord * current_x_cord * step).toInt() @@ -568,7 +698,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session // dialog!!.window!!.attributes = mParams object : CountDownTimer(500, 5) { //get params of Floating Widget view - var mParams : WindowManager.LayoutParams = dialog!!.window!!.attributes + var mParams: WindowManager.LayoutParams = dialog!!.window!!.attributes override fun onTick(t: Long) { val step = (500 - t) / 5 mParams.x = diff --git a/android/app/src/main/res/drawable/layout_rounded_bg.xml b/android/app/src/main/res/drawable/layout_rounded_bg.xml new file mode 100644 index 00000000..0c46f49b --- /dev/null +++ b/android/app/src/main/res/drawable/layout_rounded_bg.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/android/app/src/main/res/layout/activity_video_call.xml b/android/app/src/main/res/layout/activity_video_call.xml index b7ca8d8d..0b3baff7 100644 --- a/android/app/src/main/res/layout/activity_video_call.xml +++ b/android/app/src/main/res/layout/activity_video_call.xml @@ -1,5 +1,6 @@ - + android:padding="@dimen/padding_space_medium" + app:layout_constraintTop_toTopOf="parent"> + tools:text="25:45" /> @@ -47,7 +50,8 @@ android:id="@+id/activity_clingo_video_call" android:layout_width="match_parent" android:layout_height="0dp" - android:layout_weight="1" + app:layout_constraintBottom_toTopOf="@id/control_panel" + app:layout_constraintTop_toBottomOf="@+id/layout_name" tools:context=".ui.VideoCallActivity"> - - + - + - + android:padding="@dimen/padding_space_big" + app:layout_constraintBottom_toBottomOf="parent"> + android:src="@drawable/call" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:src="@drawable/ic_mini" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:scaleType="centerCrop" + android:src="@drawable/video_enabled" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/btn_minimize" + app:layout_constraintTop_toTopOf="parent" + /> + android:src="@drawable/mic_enabled" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/btn_camera" + app:layout_constraintTop_toTopOf="parent" + /> - - - + android:scaleType="centerCrop" + android:src="@drawable/audio_enabled" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/btn_mic" + app:layout_constraintTop_toTopOf="parent" + /> + + + diff --git a/android/app/src/main/res/values/dimens.xml b/android/app/src/main/res/values/dimens.xml index 2d53d554..2a4d695f 100644 --- a/android/app/src/main/res/values/dimens.xml +++ b/android/app/src/main/res/values/dimens.xml @@ -3,21 +3,27 @@ 16dp 16dp 28dp + 12dp 24dp 60dp 54dp - 64dp + 52dp + 24dp 24dp 25dp 88dp + 40dp 117dp + 50dp 50dp + 25dp 100dp + 40dp 90dp diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 58df9331..189dea42 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -254,8 +254,8 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " + - sendActivationCodeForDoctorAppResponseModel.verificationCode); + print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index e0053b81..d755af4a 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -17,6 +17,7 @@ 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/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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'; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 995ac57a..f2a32e63 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -21,8 +21,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; + final Stream videoCallDurationStream; + PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false, this.videoCallDurationStream}); @override Widget build(BuildContext context) { @@ -88,6 +90,23 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), ), ), + StreamBuilder( + stream: videoCallDurationStream, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if(snapshot.hasData && snapshot.data != null) + return InkWell( + onTap: (){ + }, + child: Container( + decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), + child: Text(snapshot.data, style: TextStyle(color: Colors.white),), + ), + ); + else + return Container(); + }, + ), ]), ), Row(children: [ From fee36336d8e1967ea0cd14326980f74265500e8f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 15 Jun 2021 14:40:11 +0300 Subject: [PATCH 096/124] 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 097/124] 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 098/124] 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 890a356d8c4afe3e931d0a6ed77ca19c79b8b1a1 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 15 Jun 2021 15:52:28 +0300 Subject: [PATCH 099/124] video fix bugs --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 42 +++++++++------ .../hmg/hmgDr/ui/VideoCallResponseListener.kt | 2 + .../hmgDr/ui/fragment/VideoCallFragment.kt | 53 +++++++++++-------- .../main/res/layout/activity_video_call.xml | 40 +++----------- 4 files changed, 66 insertions(+), 71 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index d595be97..d3c58371 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -3,6 +3,7 @@ package com.hmg.hmgDr import android.app.Activity import android.content.Intent import android.os.Bundle +import android.widget.Toast import androidx.annotation.NonNull import com.google.gson.GsonBuilder import com.hmg.hmgDr.Model.GetSessionStatusModel @@ -23,7 +24,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, private var call: MethodCall? = null private val LAUNCH_VIDEO: Int = 1 - lateinit var dialogFragment: VideoCallFragment + private var dialogFragment: VideoCallFragment? = null override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine) @@ -77,19 +78,23 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, // intent.putExtra("sessionStatusModel", sessionStatusModel) // startActivityForResult(intent, LAUNCH_VIDEO) - val arguments = Bundle() - arguments.putString("apiKey", apiKey) - arguments.putString("sessionId", sessionId) - arguments.putString("token", token) - arguments.putString("appLang", appLang) - arguments.putString("baseUrl", baseUrl) - arguments.putParcelable("sessionStatusModel", sessionStatusModel) - - val transaction = supportFragmentManager.beginTransaction() - dialogFragment = VideoCallFragment.newInstance(arguments) - dialogFragment.setCallListener(this) - dialogFragment.isCancelable = true - dialogFragment.show(transaction, "dialog") + if (dialogFragment == null){ + val arguments = Bundle() + arguments.putString("apiKey", apiKey) + arguments.putString("sessionId", sessionId) + arguments.putString("token", token) + arguments.putString("appLang", appLang) + arguments.putString("baseUrl", baseUrl) + arguments.putParcelable("sessionStatusModel", sessionStatusModel) + + val transaction = supportFragmentManager.beginTransaction() + dialogFragment = VideoCallFragment.newInstance(arguments) + dialogFragment?.let { + it.setCallListener(this) + it.isCancelable = true + it.show(transaction, "dialog") + } + } } @@ -120,6 +125,8 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, }*/ override fun onCallFinished(resultCode: Int, intent: Intent?) { + dialogFragment = null + if (resultCode == Activity.RESULT_OK) { val result : SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond") val callResponse : HashMap = HashMap() @@ -132,8 +139,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, callResponse["sessionStatus"] = jsonRes this.result?.success(callResponse) - } - if (resultCode == Activity.RESULT_CANCELED) { + } else if (resultCode == Activity.RESULT_CANCELED) { val callResponse : HashMap = HashMap() callResponse["callResponse"] = "CallEnd" @@ -141,5 +147,9 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, } } + override fun errorHandle(message: String) { + Toast.makeText(this, message, Toast.LENGTH_LONG).show() + } + } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt index e32630b4..d2ed15e0 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt @@ -5,4 +5,6 @@ import android.content.Intent interface VideoCallResponseListener { fun onCallFinished(resultCode : Int, intent: Intent? = null) + + fun errorHandle(message: String) } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index dd4613bd..6c07f462 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -103,8 +103,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onCreate(savedInstanceState: Bundle?) { requireActivity().setTheme(R.style.AppTheme) super.onCreate(savedInstanceState) - - requestPermissions() } override fun onStart() { @@ -155,8 +153,18 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session parentView = inflater.inflate(R.layout.activity_video_call, container, false) -// Objects.requireNonNull(requireActivity().actionBar)!!.hide() + // Objects.requireNonNull(requireActivity().actionBar)!!.hide() + arguments?.run { + apiKey = getString("apiKey") + sessionId = getString("sessionId") + token = getString("token") + appLang = getString("appLang") + baseUrl = getString("baseUrl") + sessionStatusModel = getParcelable("sessionStatusModel") + } initUI(parentView) + requestPermissions() + handleDragDialog() return parentView @@ -196,15 +204,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mSubscriberViewIcon = view.findViewById(R.id.remote_video_view_icon) mSubscriberViewContainer = view.findViewById(R.id.remote_video_view_container) - arguments?.run { - apiKey = getString("apiKey") - sessionId = getString("sessionId") - token = getString("token") - appLang = getString("appLang") - baseUrl = getString("baseUrl") - sessionStatusModel = getParcelable("sessionStatusModel") - } - patientName = view.findViewById(R.id.patient_name) patientName.text = sessionStatusModel!!.patientName @@ -220,8 +219,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } else { minutes = (elapsedTime - cmTimer.base) / 1000 / 60 seconds = (elapsedTime - cmTimer.base) / 1000 % 60 - elapsedTime = elapsedTime + 1000 + elapsedTime += 1000 } + arg0?.text = "$minutes:$seconds" Log.d(VideoCallFragment.TAG, "onChronometerTick: $minutes : $seconds") } @@ -257,12 +257,19 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session // progressBar.setVisibility(View.GONE); hiddenButtons() checkClientConnected() - mSubscriberViewContainer!!.setOnTouchListener { v: View?, event: MotionEvent? -> + + mSubscriberViewContainer.setOnClickListener { controlPanel!!.visibility = View.VISIBLE mVolHandler!!.removeCallbacks(mVolRunnable!!) mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) - true } + +// mSubscriberViewContainer!!.setOnTouchListener { v: View?, event: MotionEvent? -> +// controlPanel!!.visibility = View.VISIBLE +// mVolHandler!!.removeCallbacks(mVolRunnable!!) +// mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) +// true +// } if (appLang == "ar") { progressBarLayout!!.layoutDirection = View.LAYOUT_DIRECTION_RTL } @@ -347,8 +354,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(session: Session, opentokError: OpentokError) { Log.d(TAG, "onError: Error (" + opentokError.message + ") in session " + session.sessionId) -// Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() -// requireActivity().finish() + + videoCallResponseListener?.errorHandle("onError: Error (" + opentokError.message + ") in session ") + dialog?.dismiss() } override fun onStreamReceived(session: Session, stream: Stream) { @@ -385,8 +393,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(publisherKit: PublisherKit?, opentokError: OpentokError) { Log.d(VideoCallFragment.TAG, "onError: Error (" + opentokError.message + ") in publisher") -// Toast.makeText(requireContext(), "Session error. See the logcat please.", Toast.LENGTH_LONG).show() -// requireActivity().finish() + videoCallResponseListener?.errorHandle("onError: Error (" + opentokError.message + ") in publisher") + dialog?.dismiss() } override fun onVideoDataReceived(subscriberKit: SubscriberKit?) { @@ -408,6 +416,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mSession!!.subscribe(mSubscriber) } + override fun dismiss() { + videoCallResponseListener?.onCallFinished(1000) + super.dismiss() + } + private fun disconnectSession() { if (mSession == null) { videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED) @@ -478,7 +491,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } private fun setViewsVisibility() { - initUI(parentView) val iconSize : Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt() val iconSizeSmall : Int = context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt() val btnMinimizeLayoutParam : ConstraintLayout.LayoutParams = btnMinimize.layoutParams as ConstraintLayout.LayoutParams @@ -553,7 +565,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session btnMinimize.layoutParams = btnMinimizeLayoutParam mCallBtn.layoutParams = mCallBtnLayoutParam - } private fun onCameraClicked(view: View?) { diff --git a/android/app/src/main/res/layout/activity_video_call.xml b/android/app/src/main/res/layout/activity_video_call.xml index 0b3baff7..586f5b60 100644 --- a/android/app/src/main/res/layout/activity_video_call.xml +++ b/android/app/src/main/res/layout/activity_video_call.xml @@ -54,30 +54,6 @@ app:layout_constraintTop_toBottomOf="@+id/layout_name" tools:context=".ui.VideoCallActivity"> - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> From bc661a6f38ada1f1470fc175cf334a578a67b4f0 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 15 Jun 2021 16:56:51 +0300 Subject: [PATCH 100/124] fix bugs --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 47 +++++++++++------- .../com/hmg/hmgDr/ui/VideoCallActivity.java | 2 +- .../hmgDr/ui/fragment/VideoCallFragment.kt | 23 +++++---- android/app/src/main/res/drawable/call.png | Bin 13229 -> 21324 bytes .../app/src/main/res/drawable/camera_back.png | Bin 0 -> 6409 bytes .../src/main/res/drawable/camera_front.png | Bin 0 -> 7100 bytes android/app/src/main/res/drawable/expand.png | Bin 0 -> 5366 bytes .../src/main/res/drawable/flip_disapled.png | Bin 6138 -> 0 bytes .../src/main/res/drawable/flip_enabled.png | Bin 6753 -> 0 bytes android/app/src/main/res/drawable/ic_mini.xml | 16 ------ .../src/main/res/drawable/mic_disabled.png | Bin 5783 -> 6537 bytes .../app/src/main/res/drawable/mic_enabled.png | Bin 6020 -> 5904 bytes .../app/src/main/res/drawable/reducing.png | Bin 0 -> 4953 bytes .../main/res/drawable/video_disanabled.png | Bin 5113 -> 6438 bytes .../src/main/res/drawable/video_enabled.png | Bin 5338 -> 5715 bytes .../main/res/layout/activity_video_call.xml | 29 +++++------ android/app/src/main/res/values/dimens.xml | 2 +- 17 files changed, 60 insertions(+), 59 deletions(-) create mode 100644 android/app/src/main/res/drawable/camera_back.png create mode 100644 android/app/src/main/res/drawable/camera_front.png create mode 100644 android/app/src/main/res/drawable/expand.png delete mode 100644 android/app/src/main/res/drawable/flip_disapled.png delete mode 100644 android/app/src/main/res/drawable/flip_enabled.png delete mode 100644 android/app/src/main/res/drawable/ic_mini.xml create mode 100644 android/app/src/main/res/drawable/reducing.png diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index d3c58371..9d9581fe 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -43,27 +43,36 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, this.result = result this.call = call - if (call.method == "openVideoCall") { - val apiKey = call.argument("kApiKey") - val sessionId = call.argument("kSessionId") - val token = call.argument("kToken") - val appLang = call.argument("appLang") - val baseUrl = call.argument("baseUrl") + when (call.method) { + "openVideoCall" -> { + val apiKey = call.argument("kApiKey") + val sessionId = call.argument("kSessionId") + val token = call.argument("kToken") + val appLang = call.argument("appLang") + val baseUrl = call.argument("baseUrl") - // Session Status model - val VC_ID = call.argument("VC_ID") - val tokenID = call.argument("TokenID") - val generalId = call.argument("generalId") - val doctorId = call.argument("DoctorId") - val patientName = call.argument("patientName") + // Session Status model + val VC_ID = call.argument("VC_ID") + val tokenID = call.argument("TokenID") + val generalId = call.argument("generalId") + val doctorId = call.argument("DoctorId") + val patientName = call.argument("patientName") - val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName) + val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName) - openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel) + openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel) - } else { - result.notImplemented() + } + "closeVideoCall" -> { + dialogFragment?.onCallClicked() + } + "onCallConnected"->{ + + } + else -> { + result.notImplemented() + } } } @@ -94,6 +103,9 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, it.isCancelable = true it.show(transaction, "dialog") } + } else if (!dialogFragment!!.isVisible){ + val transaction = supportFragmentManager.beginTransaction() + dialogFragment!!.show(transaction, "dialog") } } @@ -148,7 +160,8 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, } override fun errorHandle(message: String) { - Toast.makeText(this, message, Toast.LENGTH_LONG).show() + dialogFragment = null +// Toast.makeText(this, message, Toast.LENGTH_LONG).show() } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java index 0fb061f1..daf372ed 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java @@ -415,7 +415,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi if (mPublisher != null) { isSwitchCameraClicked = !isSwitchCameraClicked; mPublisher.cycleCamera(); - int res = isSwitchCameraClicked ? R.drawable.flip_disapled : R.drawable.flip_enabled; + int res = isSwitchCameraClicked ? R.drawable.camera_front : R.drawable.camera_back; mSwitchCameraBtn.setImageResource(res); } } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 6c07f462..e0a92206 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -229,7 +229,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session videoCallPresenter = VideoCallPresenterImpl(this, baseUrl) mCallBtn = view.findViewById(R.id.btn_call) mCallBtn.setOnClickListener { - onCallClicked(it) + onCallClicked() } btnMinimize = view.findViewById(R.id.btn_minimize) btnMinimize.setOnClickListener { @@ -355,8 +355,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(session: Session, opentokError: OpentokError) { Log.d(TAG, "onError: Error (" + opentokError.message + ") in session " + session.sessionId) - videoCallResponseListener?.errorHandle("onError: Error (" + opentokError.message + ") in session ") - dialog?.dismiss() + videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in session ") +// dialog?.dismiss() } override fun onStreamReceived(session: Session, stream: Stream) { @@ -393,8 +393,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(publisherKit: PublisherKit?, opentokError: OpentokError) { Log.d(VideoCallFragment.TAG, "onError: Error (" + opentokError.message + ") in publisher") - videoCallResponseListener?.errorHandle("onError: Error (" + opentokError.message + ") in publisher") - dialog?.dismiss() + videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in publisher") +// dialog?.dismiss() } override fun onVideoDataReceived(subscriberKit: SubscriberKit?) { @@ -465,12 +465,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session if (mPublisher != null) { isSwitchCameraClicked = !isSwitchCameraClicked mPublisher!!.cycleCamera() - val res = if (isSwitchCameraClicked) R.drawable.flip_disapled else R.drawable.flip_enabled - mSwitchCameraBtn!!.setImageResource(res) + val res = if (isSwitchCameraClicked) R.drawable.camera_front else R.drawable.camera_back + mSwitchCameraBtn.setImageResource(res) } } - private fun onCallClicked(view: View?) { + fun onCallClicked() { disconnectSession() } @@ -487,6 +487,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session ) } isFullScreen = !isFullScreen + + val res = if (isFullScreen) R.drawable.reducing else R.drawable.expand + btnMinimize.setImageResource(res) setViewsVisibility() } @@ -518,7 +521,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session layoutName.visibility = View.VISIBLE mCameraBtn.visibility = View.VISIBLE mSwitchCameraBtn.visibility = View.VISIBLE - mspeckerBtn.visibility = View.VISIBLE +// mspeckerBtn.visibility = View.VISIBLE mMicBtn.visibility = View.VISIBLE mPublisherViewContainer.visibility = View.VISIBLE @@ -539,7 +542,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session layoutName.visibility = View.GONE mCameraBtn.visibility = View.GONE mSwitchCameraBtn.visibility = View.GONE - mspeckerBtn.visibility = View.GONE +// mspeckerBtn.visibility = View.GONE mMicBtn.visibility = View.GONE mPublisherViewContainer.visibility = View.GONE diff --git a/android/app/src/main/res/drawable/call.png b/android/app/src/main/res/drawable/call.png index fc00f4f942d7ef38336bf493a5e9ba2980692c55..52f8e267234d686e31be8a6e1b44287ab98364db 100644 GIT binary patch literal 21324 zcmYg&bzGD0_cxmphKMi_DG?;4LkY>zB}jJ((k0z7R63=5(hZW*7<3~g-5t^mznl1c zpXZOgfN|}4~QP1prBw%N{A?+pnz7cUrR_#Rp1XULp4bw85tBh;CCnr$j=l7a=iq25dkk06fhF}-#efcl)v>VzrBZhzHhm+}@`T*-_;^`yBhwQOsqO(O zReD3Z=z&G4d^W>3@dR$px>#eedm7T*e}iAYIJ@Y`@qE1&$%eLxmBi_xuq2q?rTsamQJT_$T`=mO+3BB^?fMA`t*t81QcP#%Z!{Hc zEoxS7IOJLdeukT%ll6VIbbZSFsj0UZb zWrH#S8gTncog&G8LeZ#BukPR`!E*+DpwD1a-H9LTy@y#VGLnJib3pdlk z-e5qbq@v#|Iwi0%<{ z6Spopl@Rh6g1s{LGF!|KS`g1^?aHR&5hK!S++o)_($QVl^fisPr4>T?bBYXhc#q>J z)B5z$%x+4`Cch)vAK^DBh(|W_XWa+vW-czJ)F-y-R6@h2Z{kb;FigW5PZ0H@l;MQ- zS*cNOiy%VhL%6!r26N{Sk-BIICU}Yl&|G7PkmW3{RCM$Z6aRQl+c*`uYgtp=V>2=? z-4~$vpN3me%6(QcR%%Yuv~*=p&Au9bAq5vV!a>Kt6y<{g)_$-y=<*N*TWrfqIQ^4(b}HnO z;_f*b)4_`hr3sX3Vp68lo@xAY@(=iE6(6}k@M;_DgO z7!TdAeIF2B-JBnvK*qubig&74M~$D%Aa7q!;N}?@mu*&uet(OCa7<-oe@Ibc_QS_? z)nt)JG-{eLVmHW7dkGty@|-N-+$nt&b6+G@1qhhspQAkqZT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-Qcr{A&?`$bS!HXqb&}P zN(?{{Ik4fV^f9T4A;1gLMqd;jofw55h#*hv{3pd{JFX=HpNbSr>yIwM5CbGcj;D0^ z>FB7K0b?NWkw`Jf;$4%*1w{-D7CC;b!_TD*&P~!sfWb8{T@LDf$iWc79M1^4=;Ac=t=h#c6)xZ`m?n!Fc0{^hs%yZIIom3xnz_QeK;RE4Ic) z?NlPj{Q~@7qz}ageB$=F4`7>5H|7lNw#%F7dBPlo16oQAgr1*{$RIma_y^nh$CKu z5X?4xEJ6ggdff$=WF1EYVb+SlIV zD4wJULRdw3MVMuagat6wM;7NG1V12RJh3*icEl(@S&@Y4U4H+;K;8CX-2sQS2L{x< z^)Jcs!<}Zj|E@JL%Fu`;59l)lLDy|P1Oi-@cK-j^DkBLoVpKdvk>s#0(~~?RO?5_# znI+!F!OI7t+Q%fDdlw^y1LAxxE#Ae5(E?Ht z1-uBkHlzhvLY)F;_6P!?kl~-}Hh@-}R~942%Fx}pQDk9ei_MJlI@CCY@c{$o85Ifa z{lEfcRWV|$id@ZoA`CrAK^Dlv=Ryg`=Ff|@6&B9;wkOQtIDgJ(oE{>4W8sic=t2G; X_h{;p&xF^300000NkvXXu0mjfo)PYq literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable/camera_front.png b/android/app/src/main/res/drawable/camera_front.png new file mode 100644 index 0000000000000000000000000000000000000000..332ab0f54dc44ca81ed878c6788b6accf5b35039 GIT binary patch literal 7100 zcmV;t8$;xYP)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91#-IZL z1ONa40RR91$^ZZW0E2h5SpWbVGD$>1RCodHoeQvCRe8rxlu7{6fI#RN;X*CBM5Wpg zpi)Rus)T|<$h2S$6>BHp$TR`9(^7DzlK_gAklHG*aiCBN)-c#&2^HZ2RvrP`4iX+k zyacLXkVb)oB9i`phqEsGp1a>?Ki1yo`)0no_g;HFzV+Yhf7g4RX&sYN5ZJbD+glXz z9O8n=cLa|f8M)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f0z-6WA28DYR2Kf1YjH?26UBt@@ z+i6zE*4h|3<0A>iSdN*-3~xCjEszM7VlB>Mhyi$qL@J?|_5`J#KGI@5Uts?P|4+g9mG z3b!c?^YfF%Sh%r&DBDf4J0Y9d;j@8!8?+G*jy~At18<&Jkz@J9#r>%1TbCla0LJ!snB2HtVc&3L_{outx{O30FZA9NV?jBpn?K5 z8Ak;)epi_q`Jt!Mtm`7=a083@M-&hQxB&ohu*4L^1_8KR>4K&I2m8+~Wa9pEW&i*H M07*qoM6N<$f_}5^H~;_u diff --git a/android/app/src/main/res/drawable/flip_enabled.png b/android/app/src/main/res/drawable/flip_enabled.png deleted file mode 100644 index 152dc10e559c1d207f693225258f9a4ca77723f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6753 zcmY+JWl&sAw61a21h>K6T?Y#Z&fxCBZ3ylz87#QF6C8pBcMI-51HmCc_;9qEvS`H)txga|KvdVS3HqfHIrh_yrdF>cla8>P54b9Z25BHK z=%}s6*{*!4E2IcVTN}QhFb+ge1=6-6XK9Wnm=|@+|HClxNBKKX^EW(eqRRr+{GOJe znz6LvwZ+R{QSLAF5#IpVR+BEmP9WuRCZZ0Hp`?wke&mWI=$H8D$G`3!)^%B0jy3|O zehay3S;pFDnibZvC@lO4a5zqzgAC{_FtUW;C8$}1>W8E2@GY(!SNtqX<6IJ!G0Ly0 zDm+&+E+{VN0(<9mOByrG@#`@5jFGoLn&gxiq_a=udRH|x!@P;q3sj9kDWz*C);x5L zKGjMWgWou@pwPTCJNfe){(3(#MFrLWQrIin=2MC7mJ>170xt;8g#97$JTrOGnNge~ zraYO%96_|jy_#9z!3fF)pDKG+zi#RgXWcK_+LV8$kYW@H9UeW3P99BJf*k<}c$*XM zJ(5Gzh)@;3pn}OqHBe3N>lfz|=5eBAh1~ob?v{zzv+3sBaR%6%~ELt0d=yUfn4a4=_s8glA&MmRHqweAD#$uyX zuQZ(7_#rSwq=@NUI*8|tA9zS3{NEKmGhe5aIk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100644 index 29df8da2..00000000 --- a/android/app/src/main/res/drawable/ic_mini.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/android/app/src/main/res/drawable/mic_disabled.png b/android/app/src/main/res/drawable/mic_disabled.png index 3603df754eb3df74c1cf7730a90df21bfa5f7337..266cb6c72418b5aba18b32c421c2b4e75f05e47e 100644 GIT binary patch literal 6537 zcmX{*cQ_l|*AbBhLF_1v2r4m3tkRZBtWY!d-bL+Mdym+$wbUr8R_RcC2c@dKt+yHlF@J~++ zP+qyI<|A39C`(mH;e=MRRLEx{Zus&p@ZsfjCt=oM7hYcRC$Dbt$i@xD-2lVF(d7N^ zMY-8_zq?ECqJMw>>+r+yZpB#a)alge#?89li+hSG1T>^fHM)xv$`&`L7KxKi3VmVx z$mK-SXd-6IX{%}_cT<;d4(OBMo8;^9?$H~ZfF@9@Qh(q$(2X^*;>3<_o!b8_Y)!e1 zU!LhhGM>QExCihw&^C^jEE1y7rW=t%Rs>auwZ(gDf$Qq|=p&KWl`NWnU>eG4LF_D` zB={9%Z6@T36h?#5SX{_8o!7Z!fa;kGonJi)^-y_nT|VO(f0i}i!3Dd^Uus@tB*O=) z2`M)RG2{OHM{JehdA%OH{6=|eDne;aYejJ6@KqUzZ_-8~)T67pMCZFI;d`M^L*|8z z^mCN**4xr5kzva%1|xQNkTvYb<$`k8fO0|}zjGXy@Jwe8-Y+3NOq&`@UdNED2P5Z> z)?dkE)lyz=_ zFraArm*Lfc#H}!KY2^!sZE-MO^}qC4mOySIWxiC!_{jNapP|UjRr(MEg`I%GR4L6d-Q_-tXdl7<3rdjvyx0?dabKV zg)m={vsHfz87!>eY@Xr}XgxPn;f{UKW zRvypGgOO29xr)ak^)xtgUznni z&LkNB0lm^fRq2EDqhm!yir^#l?`%BG1!MK|Z5g#4<+d#<-q)L<>WIh@2cZ0w)?_Y5 z!Ov!<`=zg5*U$bjTYyM;J-ne6uq}U~xmW51PsXwcN=C4->#B}PBLzlZv&H1!(RR8m za$NQv6A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pk3E|feXvfaH7E*0Lo#^xJp8x>R$l3-Qni9gk!U|5bmmNhh*iJGT$xnuoD@^!KDz7 zj_e~-G11xqlW(zEp7k)jzeFTf1d{@Uj9 zhHd*#2@h500kB>it<7CfxL**n?kMmx+H5_*mBS`L3WNd3=CWUTxlX2PS+W;A`oRBxY5??{p zN&wtWaLN zBX_js2FN`+wU#V=AGsT659~|i*y%c0w1x0|2WBZ?a-p`b#FtP_4FPaAu30=k1jErF zdp9V!6D3uMh{Iu@!mxNPNmRu3iO2U)%^wB8ERsjV5b!vddtl VdluGjNo@cC002ovPDHLkV1l9-OF94m diff --git a/android/app/src/main/res/drawable/mic_enabled.png b/android/app/src/main/res/drawable/mic_enabled.png index 5d9aa6770cc43554a3767cf6b1c45fd3a8851410..ef7617f7ac43e7d7f55f48bcc1df718661b48f00 100644 GIT binary patch literal 5904 zcmV+r7w_naP)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91#-IZL z1ONa40RR91$^ZZW0E2h5SpWbQhDk(0RCodHok`3k*I9=Bd+2zc0EvYoRxBE^$cDxNv4DWW0!ZT_?sm7` zp4v`(Xt(Wd-sk>RH+AdQT&L#ulfGM3r_T7+_uezsshtZfogi@j{P_zN@nzCWrTe58 zOL4m>aZH|bA9+vuzVuvlOrLXoR(b~A+1cUR5*UGWP{d5g<`tAtnROr6mc? zte7P3n+S|W6GLR6Srn7uiX}0jpsa7|UQ802UyGE*5kq94vwU5o^c@z5K}AbHFMsq& zAjv5;w-`QNj4Z||B0}7#CwsHBuc6er7!pImC#5foAd8qcnLRNgLO_O_q+=agRn{gU zkm5z@$+;6`w#10~54Y$cQcIW+0wJJ4ke8$oWS0Gq*%3p8pqUgCf+ZN1?hv5g@v`&< z5rpQ}Y-BdX5FsD|grM1ELiB5*5QIJm1erxAeHO$JDX!5&`H+-#OP1jfU=HM{$npAc zSqPKzq=_LyFe`nB^x80RIF>*Nyry`b6G50=pQKEZ7;ZLA!q(#E)$<|2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yW>;o z%?vv}i#`LpE-|Pug$BII@(cGmh{s>+YUU8$%5Q0iqdr~5Pu2E7b^d)Fg0ivqiJD-k zyc@`rCFJAP;-tpz%YN+ZM$g{#7S|uh5GNU$0;AaEmiRmyXrQQ!-ingZeKK@Ujuo(d zEUAs!D0m!f?w(<`p`B*GDh4bJFbX8HS>X_%oXdKs2_c;JEf2{bxHTj`W%^) zxS4{+*p=1&JqTpbgT#AJHepH%R^LTs-#VW{~tNb Bb}|3} diff --git a/android/app/src/main/res/drawable/reducing.png b/android/app/src/main/res/drawable/reducing.png new file mode 100644 index 0000000000000000000000000000000000000000..59f2c9e6faa03d35596a52689b19f99db9e09036 GIT binary patch literal 4953 zcmYLNcTm&K(+`mZ_)v~<>4pG-(4|=@Qp83L5Ksgu(m@ElCDMBf zsFX;ND!nM86e-db@Q44r@9gaD-rZ+z_ilFgZtexf=q4+`2Y^5zR$U!U?5U*vV@Bv{ zyXZVubSmh4us78~Z~OU|Pdf_E7P>Bmh9JpPoe@MAaSufQ4|2+UrwjstN#Oq*p^?t~ zzy5EM>%lZ52*fd&V=1M$;O)c? zZou4nN{7gizWPqOXJy?cJQxu6?PBbQjLU7Ya*VYMIa zO2yQo#*224O{;#!6t~9LRdiahn|XKT{52wwOR zgs_O`f2_-P>S)@JJ?F3+4LcHswF@wkMCbDp@pm&hR=v7#O?1aNV~b@};OwIJKg^V(Z&1jXj^vJn*`crof@dKzQnPZl^TV10{&KrzeN6EVG z-WYl&pBf{H@q1a-ND)7uPOBn(Yq~7)b%?OekG=ecZ;!PLq#(<4=^l>SzwqxLaHO-q z&>bCY1IT&m6q$Mn;<>i0;&NOu=+1Gv(v`q0Ov>U(Zt2?jPHgbH+FHdobdxHbje8N=&X%3?FoKGObNV>(@=pH?|u&&kA#ng3ozP zv+AZhEckqck)~BjWv@+6y5$Dvuw1^D>BX_{k$B_L#%d18dHHD~#kg}8%Am!2+ds^U z!v#D=Rx^O${swFCzU1A&S%-$?u&}q?oUU`)fAt(7yZD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{oEW4P0tyg6T0-QP1)kzeTilj-39 PzPNO?j5Ob>+lTxQOg$37 literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/drawable/video_disanabled.png b/android/app/src/main/res/drawable/video_disanabled.png index 5c20c7bdecf06cb8401b40b1a27bce46cf35c4a9..d6ccbe7ad12d75da1c17e054c8af03e00273c8ef 100644 GIT binary patch literal 6438 zcmV+>8QJEEP)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91%Af-P z1ONa40RR91#{d8T0Pg=7xc~qdoJmAMRCodHT?w=m#hEUHEFuUZ$|4BJQGr2O1cd|0 z6Vy>mo>2)Z7-FKJnzP(g;|NlAv>+b4W{{O4`UR8D1tv*MI1d71fvuE3)fU7ck zDUQvdO*7iWcCN!(AdGSd`b7c#4EOd!w?ns`bIv&*;3yIh0_OyjZ>q8d85+Xju24+~ z`;lY_Lk^=5lExyA{Tw7Z9){zG{@1@Dql0nm0j&o$QBK3CjnGQ1AP##Y z5f=yuQ5=8;VqA=9L!cxDmAyw?u{#UftDu@Vt3jMU;aa2s0&%VE0xtP;3*_jGobJl# z^*AOKD-vftbOH1~K$`b)6v;v$sgfo+uzkZ(yf;4i2eA{(`_(oU*4`0Mc-tlUhj~Q9um(JOHZ6(IK_9@6Pf6Lv)KY zIKBhoaLAS#Nfl8*l5VKkzk`l|n);N=^v1`hXfHs23bJf5-B`cuO9fFtkbVH{@1eu| z0#5R=5Lkl0KLKI*Fd)&ASfXTxSYJi$O@(r(B@!G0YmxO#=qpJbk|mBPAV_^w*cj+! zDBqBagoglE1v~+L4um-wUa`TKlqjNrBsT)GUqbl~L?k){cB1IgcTZ4k9h9Oji%c~#pIx!)Q2;O>^ZpLnKA%Gp9t#Ba!pi&5yYQb~EF=~^3J6jU z`ePtk2^EsWqG=U0l66>#I(>w7TQH^}H;wO60AxF0#a?8fA()97{vxmj*|B%o=Wn+D z=4Nz{0+QSTcdMX65`XL6q}*7yRhhar$*x+q7)ca>)(H9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+~M)%5^ zChR1}K1Gf$D7;N(xBS||k0YLm=TMn)fMxIFC!y1!jiE|dr~Povcd{6x>-;njS*I^v zm;G{wV>B9j{TX#nM#CNp>}c>Bfbuh@r;-$?`VIiM9sGQk@Y}2{gu7_N9$C1qM9%np z85KLxhKEBT9vswFMxvv&1167RE;R)(*@Gl0l2oYrjsSNU{2VfASADqe@|A1y>85?M zWYbHI} z<6~EBJs_*LAM#|;d;3ChdN_hRuU9)6+NXm#oY0JgJ?B~Se+NKQG8*5TUaAl?nTj|vx6=K`=^Ev>Du7tZA@D4aBdb1ZO3eqEy}$T*&Z%3g-P511*f zv!xuWVH7^SBd|RQIue>`?$dtG^TZ{a378AQda>Rsr-tK9Vg%U-)e>V`8=Va8vYCwI zdFKEmM+^Ewd<9io1aMozKOQ;(nxn(Rxm-Po>xXjQ2Ch!X#q7BD8N-!gAs(*V!eu@( z>()_oN@UfmqvrGDoPL}Dne*jxdR5NG$;lgyx&Fdkl3{D1Z$jq-CI@Q!N_+{`v=9Jy z$2PO)d!hUqWX}c#f3oBPF2v7a%b?6&cP8t?Rk@Dup_(@Zz|4|!p#(e>+7If*44M24 zwi&ttN|0*+l38uFkZJ`roJ9e;HNsgn(%KDve%ECqhpGICe-X-t0800000NkvXXu0mjfcoxVS diff --git a/android/app/src/main/res/drawable/video_enabled.png b/android/app/src/main/res/drawable/video_enabled.png index 23331e3083cbd75a5c17e37bbdd3e89a291141f7..6fcbe75041fb80538006600a8620f7081c215d2d 100644 GIT binary patch literal 5715 zcmYLNcRUpS|35l8qug=!zB?nG9mxva;m$l{uZ%K6*()n_XT>>(D0N23-pTAj4pEn6 zWR+QDri}Rd{PX+$@p`}3`|*6eUhl{I{dl}zFM_$L!8uj|RsaBS4r7S2IOPNX5$Npc zy5Kqc;*>E2Ss3U6s)vPEPZc#!Tg*)p6M)RA3<5Ab@CE??+j2?*rvv~nK4ttr%fQn! z|1baNzfWJ-J4s?upo)30bZr{7E744Oa` zRL+jHDR&JWM%|jpR}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SD z3dy9#LilLOE&i|Q`ab#Y)pE2f!=C8vk(vQZ`&HJ08QxjJXAg-5PQvXB-FJnB?)^O~ zpxd$By2fDRtFeBj%Dfr=x*T1(zR=tv->hV8nRgyBBVo~!j(qq#Oj7)xOApVmJMK~^ z6&*+j&d)o2#erE?{zH{Bm{0hs=QPNRsNsbq!wK|#aq7G8NvDfNaQ?6l<%~-`BWy(dC18+m%{VH@(J_CI|J$&+9wpDsN?! zg3yf7DRv8-x*RVU$4z=&f929e44n^=PO1nJ>suJD-)-DBZx-Xtc%|Ify(r*~d88Hx zW#NfN9BvFz(=Cc8hWdY&=9Aue_>;iKImWwfNn~AmF=->|OM>7}ga5zS$X!|7m9z=< zI3gZN7q^nl>LaK#b*~o5qZbLLr;!~AjKgo$L;WmZx3&+Eiu=}#UrJF@2h%Dl&N23% zqxY;4oxx$Ll=I*qm-&F6-H^CI4y2B-Gcfg8tg4gMtRf+#YJJdz(drmu)nHQAQqv18 z+-IUQIJ}6Vuhc7qFNb4}N!<|w#sqLi{4*WxXP6nAy zu!!^OZ2agrU*P~=-&C!Nc^)jLA^SA6+p5(pL`F~6GaB`lYwjD0las&^XRKC{_&F{q|sygxt6Z=7uZAzqy|$TQ)oHG1$y!LjEVQ z1?sDy)Glc`jdO-+ypX*>Zpp~)-g$`|kZs4@$bpII;V5oi7U(Xze&0(Y;SrhIL2rym zYyG#{KS=t&y#y`fBmGYA{``z3$q;%sJdtdAXDZ{cKv$#mTzlfzwyxhT2xLJLHgh0G he`HdmC}gyD$L5b3dLYnWBmD1P5u&cAR- @@ -89,18 +90,6 @@ android:src="@drawable/video_off_fill" /> - - @@ -152,6 +141,17 @@ app:layout_constraintStart_toEndOf="@id/btn_camera" app:layout_constraintTop_toTopOf="parent" /> + + diff --git a/android/app/src/main/res/values/dimens.xml b/android/app/src/main/res/values/dimens.xml index 2a4d695f..0694f5f4 100644 --- a/android/app/src/main/res/values/dimens.xml +++ b/android/app/src/main/res/values/dimens.xml @@ -29,7 +29,7 @@ 14sp 16sp - 24sp + 22sp 4dp From 259a63384e658cbaf18a722c57f9d234e2b363b9 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 16 Jun 2021 09:53:28 +0300 Subject: [PATCH 101/124] fix draggable bugs --- .../com/hmg/hmgDr/ui/VideoCallActivity.java | 5 +- .../hmgDr/ui/fragment/VideoCallFragment.kt | 68 ++++++++++-------- ...ideo_disanabled.png => video_disabled.png} | Bin lib/config/config.dart | 4 +- 4 files changed, 42 insertions(+), 35 deletions(-) rename android/app/src/main/res/drawable/{video_disanabled.png => video_disabled.png} (100%) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java index daf372ed..75590b76 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java @@ -20,7 +20,6 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; -import android.widget.Toast; import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; import com.hmg.hmgDr.Model.GetSessionStatusModel; @@ -63,7 +62,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi private Runnable mVolRunnable, mConnectedRunnable; private FrameLayout mPublisherViewContainer; - private RelativeLayout mSubscriberViewContainer; + private FrameLayout mSubscriberViewContainer; private RelativeLayout controlPanel; private String apiKey; @@ -432,7 +431,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi if (mPublisher != null) { isCameraClicked = !isCameraClicked; mPublisher.setPublishVideo(!isCameraClicked); - int res = isCameraClicked ? R.drawable.video_disanabled : R.drawable.video_enabled; + int res = isCameraClicked ? R.drawable.video_disabled : R.drawable.video_enabled; mCameraBtn.setImageResource(res); } } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index e0a92206..95f54ca8 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -17,6 +17,7 @@ import android.widget.* import androidx.annotation.Nullable import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet +import androidx.core.view.GestureDetectorCompat import androidx.fragment.app.DialogFragment import com.hmg.hmgDr.Model.GetSessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel @@ -97,8 +98,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private var isConnected = false private var sessionStatusModel: GetSessionStatusModel? = null - private var videoCallResponseListener: VideoCallResponseListener? =null - + private var videoCallResponseListener: VideoCallResponseListener? = null + private lateinit var mDetector: GestureDetectorCompat override fun onCreate(savedInstanceState: Bundle?) { requireActivity().setTheme(R.style.AppTheme) @@ -144,12 +145,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } } - fun setCallListener(videoCallResponseListener: VideoCallResponseListener){ + fun setCallListener(videoCallResponseListener: VideoCallResponseListener) { this.videoCallResponseListener = videoCallResponseListener } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View? { + savedInstanceState: Bundle?): View { parentView = inflater.inflate(R.layout.activity_video_call, container, false) @@ -166,10 +167,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session requestPermissions() handleDragDialog() + mDetector = GestureDetectorCompat(context, MyGestureListener { showControlPanelTemporarily() }) return parentView } + override fun onPause() { super.onPause() if (mSession == null) { @@ -258,18 +261,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session hiddenButtons() checkClientConnected() - mSubscriberViewContainer.setOnClickListener { - controlPanel!!.visibility = View.VISIBLE - mVolHandler!!.removeCallbacks(mVolRunnable!!) - mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) - } - -// mSubscriberViewContainer!!.setOnTouchListener { v: View?, event: MotionEvent? -> -// controlPanel!!.visibility = View.VISIBLE -// mVolHandler!!.removeCallbacks(mVolRunnable!!) -// mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) -// true -// } if (appLang == "ar") { progressBarLayout!!.layoutDirection = View.LAYOUT_DIRECTION_RTL } @@ -474,7 +465,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session disconnectSession() } - private fun onMinimizedClicked(view: View?) { + private fun onMinimizedClicked(view: View?) { if (isFullScreen) { dialog?.window?.setLayout( 400, @@ -494,10 +485,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } private fun setViewsVisibility() { - val iconSize : Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt() - val iconSizeSmall : Int = context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt() - val btnMinimizeLayoutParam : ConstraintLayout.LayoutParams = btnMinimize.layoutParams as ConstraintLayout.LayoutParams - val mCallBtnLayoutParam : ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams + val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt() + val iconSizeSmall: Int = context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt() + val btnMinimizeLayoutParam: ConstraintLayout.LayoutParams = btnMinimize.layoutParams as ConstraintLayout.LayoutParams + val mCallBtnLayoutParam: ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams // val localPreviewMargin : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() // val localPreviewWidth : Int = context!!.resources.getDimension(R.dimen.local_preview_width).toInt() @@ -512,7 +503,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session val remotePreviewIconSize: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt() val remotePreviewIconSizeSmall: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() - val remotePreviewLayoutParam : FrameLayout.LayoutParams = mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams + val remotePreviewLayoutParam: FrameLayout.LayoutParams = mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams val constraintSet = ConstraintSet() //layoutParam.constrain @@ -574,7 +565,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session if (mPublisher != null) { isCameraClicked = !isCameraClicked mPublisher!!.publishVideo = !isCameraClicked - val res = if (isCameraClicked) R.drawable.video_disanabled else R.drawable.video_enabled + val res = if (isCameraClicked) R.drawable.video_disabled else R.drawable.video_enabled mCameraBtn!!.setImageResource(res) } } @@ -604,12 +595,13 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session getWindowManagerDefaultDisplay() videoCallContainer.setOnTouchListener(dragListener) -// mSubscriberViewContainer.setOnTouchListener(dragListener) + mSubscriberViewContainer.setOnTouchListener(dragListener) } @SuppressLint("ClickableViewAccessibility") - val dragListener : View.OnTouchListener = View.OnTouchListener{ _, event -> - //Get Floating widget view params + val dragListener: View.OnTouchListener = View.OnTouchListener { _, event -> + mDetector.onTouchEvent(event) + //Get Floating widget view params val layoutParams: WindowManager.LayoutParams = dialog!!.window!!.attributes //get the touch location coordinates @@ -636,11 +628,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session val barHeight: Int = getStatusBarHeight() if (y_cord_Destination < 0) { // y_cord_Destination = 0 - y_cord_Destination = - -(szWindow.y - (videoCallContainer.height /*+ barHeight*/)) +// y_cord_Destination = +// -(szWindow.y - (videoCallContainer.height /*+ barHeight*/)) + y_cord_Destination = - (szWindow.y/2) } else if (y_cord_Destination + (videoCallContainer.height + barHeight) > szWindow.y) { - y_cord_Destination = - szWindow.y - (videoCallContainer.height + barHeight) +// y_cord_Destination = szWindow.y - (videoCallContainer.height + barHeight) + y_cord_Destination = (szWindow.y/2) } layoutParams.y = y_cord_Destination @@ -662,6 +655,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session true } + private fun showControlPanelTemporarily() { + controlPanel!!.visibility = View.VISIBLE + mVolHandler!!.removeCallbacks(mVolRunnable!!) + mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) + } + /* Reset position of Floating Widget view on dragging */ private fun resetPosition(x_cord_now: Int) { if (x_cord_now <= szWindow.x / 2) { @@ -741,6 +740,15 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session ).toInt() } + private class MyGestureListener(val onTabCall: () -> Unit) : GestureDetector.SimpleOnGestureListener() { + + override fun onSingleTapConfirmed(event: MotionEvent): Boolean { + onTabCall() + return true + } + + } + companion object { @JvmStatic fun newInstance(args: Bundle) = diff --git a/android/app/src/main/res/drawable/video_disanabled.png b/android/app/src/main/res/drawable/video_disabled.png similarity index 100% rename from android/app/src/main/res/drawable/video_disanabled.png rename to android/app/src/main/res/drawable/video_disabled.png 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"; From 1ed22e68e3f96b113d569abeeef5f441e5652ae1 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 16 Jun 2021 10:13:58 +0300 Subject: [PATCH 102/124] video fix bugs --- .../hmgDr/ui/fragment/VideoCallFragment.kt | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 95f54ca8..f7f70e40 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -325,7 +325,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session Log.i(TAG, "Session Connected") mPublisher = Publisher.Builder(requireContext()).build() mPublisher!!.setPublisherListener(this) - mPublisherViewContainer!!.addView(mPublisher!!.view) + mPublisherViewContainer.addView(mPublisher!!.view) if (mPublisher!!.getView() is GLSurfaceView) { (mPublisher!!.getView() as GLSurfaceView).setZOrderOnTop(true) } @@ -490,42 +490,37 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session val btnMinimizeLayoutParam: ConstraintLayout.LayoutParams = btnMinimize.layoutParams as ConstraintLayout.LayoutParams val mCallBtnLayoutParam: ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams -// val localPreviewMargin : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() -// val localPreviewWidth : Int = context!!.resources.getDimension(R.dimen.local_preview_width).toInt() -// val localPreviewHeight : Int = context!!.resources.getDimension(R.dimen.local_preview_height).toInt() + val localPreviewMargin : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() + val localPreviewWidth : Int = context!!.resources.getDimension(R.dimen.local_preview_width).toInt() + val localPreviewHeight : Int = context!!.resources.getDimension(R.dimen.local_preview_height).toInt() // val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt() // val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt() // val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt() // val localPreviewHeightSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_height_small).toInt() // val localPreviewIconSmall: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size_small).toInt() // val localPreviewLayoutIconParam : FrameLayout.LayoutParams -// val localPreviewLayoutParam : RelativeLayout.LayoutParams = mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams + val localPreviewLayoutParam : RelativeLayout.LayoutParams = mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams val remotePreviewIconSize: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt() val remotePreviewIconSizeSmall: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() val remotePreviewLayoutParam: FrameLayout.LayoutParams = mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams - val constraintSet = ConstraintSet() - //layoutParam.constrain -// constraintSet. if (isFullScreen) { layoutName.visibility = View.VISIBLE mCameraBtn.visibility = View.VISIBLE mSwitchCameraBtn.visibility = View.VISIBLE // mspeckerBtn.visibility = View.VISIBLE mMicBtn.visibility = View.VISIBLE - mPublisherViewContainer.visibility = View.VISIBLE -// layoutParam = ConstraintLayout.LayoutParams(iconSize, iconSize) btnMinimizeLayoutParam.width = iconSize btnMinimizeLayoutParam.height = iconSize mCallBtnLayoutParam.width = iconSize mCallBtnLayoutParam.height = iconSize // localPreviewLayoutIconParam = FrameLayout.LayoutParams(localPreviewIconSize, localPreviewIconSize) //// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidth, localPreviewHeight) -// localPreviewLayoutParam.width = localPreviewIconSize -// localPreviewLayoutParam.height = localPreviewIconSize -// localPreviewLayoutParam.setMargins(0,localPreviewMargin, localPreviewMargin, 0) + localPreviewLayoutParam.width = localPreviewWidth + localPreviewLayoutParam.height = localPreviewHeight + localPreviewLayoutParam.setMargins(0,localPreviewMargin, localPreviewMargin, 0) // remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSize, remotePreviewIconSize) remotePreviewLayoutParam.width = remotePreviewIconSize remotePreviewLayoutParam.height = remotePreviewIconSize @@ -535,7 +530,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mSwitchCameraBtn.visibility = View.GONE // mspeckerBtn.visibility = View.GONE mMicBtn.visibility = View.GONE - mPublisherViewContainer.visibility = View.GONE +// mPublisherViewContainer.visibility = View.GONE +// mPublisherViewIcon.visibility = View.GONE // layoutParam = ConstraintLayout.LayoutParams(iconSizeSmall, iconSizeSmall) btnMinimizeLayoutParam.width = iconSizeSmall @@ -543,6 +539,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mCallBtnLayoutParam.width = iconSizeSmall mCallBtnLayoutParam.height = iconSizeSmall + localPreviewLayoutParam.width = 0 + localPreviewLayoutParam.height = 0 + localPreviewLayoutParam.setMargins(0,localPreviewMargin / 2, localPreviewMargin/ 2, 0) // localPreviewLayoutIconParam = FrameLayout.LayoutParams(localPreviewIconSmall, localPreviewIconSmall) //// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidthSmall, localPreviewHeightSmall) // localPreviewLayoutParam.width = localPreviewWidthSmall @@ -553,7 +552,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session remotePreviewLayoutParam.height = remotePreviewIconSizeSmall } -// mPublisherViewContainer.layoutParams = localPreviewLayoutParam + mPublisherViewContainer.layoutParams = localPreviewLayoutParam // mPublisherViewIcon.layoutParams = localPreviewLayoutIconParam mSubscriberViewIcon.layoutParams = remotePreviewLayoutParam From 7c7aa781aa67e9d68f0e989f9d70e4f7f6b0763b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 16 Jun 2021 11:12:48 +0300 Subject: [PATCH 103/124] video fix bugs --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 74 ++++++++++--------- .../hmg/hmgDr/ui/VideoCallResponseListener.kt | 2 + .../hmgDr/ui/fragment/VideoCallFragment.kt | 6 +- 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index 9d9581fe..7ddc03e4 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -20,6 +20,7 @@ import io.flutter.plugins.GeneratedPluginRegistrant class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, VideoCallResponseListener { private val CHANNEL = "Dr.cloudSolution/videoCall" + private lateinit var methodChannel: MethodChannel private var result: MethodChannel.Result? = null private var call: MethodCall? = null private val LAUNCH_VIDEO: Int = 1 @@ -29,15 +30,10 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine) - MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler(this) + methodChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL) + methodChannel.setMethodCallHandler(this) } - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - } - - override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { this.result = result @@ -67,7 +63,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, "closeVideoCall" -> { dialogFragment?.onCallClicked() } - "onCallConnected"->{ + "onCallConnected" -> { } else -> { @@ -87,7 +83,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, // intent.putExtra("sessionStatusModel", sessionStatusModel) // startActivityForResult(intent, LAUNCH_VIDEO) - if (dialogFragment == null){ + if (dialogFragment == null) { val arguments = Bundle() arguments.putString("apiKey", apiKey) arguments.putString("sessionId", sessionId) @@ -103,47 +99,47 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, it.isCancelable = true it.show(transaction, "dialog") } - } else if (!dialogFragment!!.isVisible){ + } else if (!dialogFragment!!.isVisible) { val transaction = supportFragmentManager.beginTransaction() dialogFragment!!.show(transaction, "dialog") } } - /* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { - super.onActivityResult(requestCode, resultCode, data) - var asd = ""; - if (requestCode == LAUNCH_VIDEO) { - if (resultCode == Activity.RESULT_OK) { - val result : SessionStatusModel? = data?.getParcelableExtra("sessionStatusNotRespond") - val callResponse : HashMap = HashMap() + /* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + var asd = ""; + if (requestCode == LAUNCH_VIDEO) { + if (resultCode == Activity.RESULT_OK) { + val result : SessionStatusModel? = data?.getParcelableExtra("sessionStatusNotRespond") + val callResponse : HashMap = HashMap() - val sessionStatus : HashMap = HashMap() - val gson = GsonBuilder().serializeNulls().create() + val sessionStatus : HashMap = HashMap() + val gson = GsonBuilder().serializeNulls().create() - callResponse["callResponse"] = "CallNotRespond" - val jsonRes = gson.toJson(result) - callResponse["sessionStatus"] = jsonRes + callResponse["callResponse"] = "CallNotRespond" + val jsonRes = gson.toJson(result) + callResponse["sessionStatus"] = jsonRes - this.result?.success(callResponse) - } - if (resultCode == Activity.RESULT_CANCELED) { - val callResponse : HashMap = HashMap() - callResponse["callResponse"] = "CallEnd" + this.result?.success(callResponse) + } + if (resultCode == Activity.RESULT_CANCELED) { + val callResponse : HashMap = HashMap() + callResponse["callResponse"] = "CallEnd" - result?.success(callResponse) - } - } - }*/ + result?.success(callResponse) + } + } + }*/ override fun onCallFinished(resultCode: Int, intent: Intent?) { dialogFragment = null if (resultCode == Activity.RESULT_OK) { - val result : SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond") - val callResponse : HashMap = HashMap() + val result: SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond") + val callResponse: HashMap = HashMap() - val sessionStatus : HashMap = HashMap() + val sessionStatus: HashMap = HashMap() val gson = GsonBuilder().serializeNulls().create() callResponse["callResponse"] = "CallNotRespond" @@ -152,9 +148,8 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, this.result?.success(callResponse) } else if (resultCode == Activity.RESULT_CANCELED) { - val callResponse : HashMap = HashMap() + val callResponse: HashMap = HashMap() callResponse["callResponse"] = "CallEnd" - result?.success(callResponse) } } @@ -164,5 +159,12 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, // Toast.makeText(this, message, Toast.LENGTH_LONG).show() } + override fun minimizeVideoEvent(isMinimize: Boolean) { + if (isMinimize) + methodChannel.invokeMethod("onCallConnected", null) + else + methodChannel.invokeMethod("onCallDisconnected", null) + } + } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt index d2ed15e0..eceed01e 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt @@ -7,4 +7,6 @@ interface VideoCallResponseListener { fun onCallFinished(resultCode : Int, intent: Intent? = null) fun errorHandle(message: String) + + fun minimizeVideoEvent(isMinimize : Boolean) } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index f7f70e40..03883361 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -420,13 +420,13 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session return } if (mSubscriber != null) { - mSubscriberViewContainer!!.removeView(mSubscriber!!.view) + mSubscriberViewContainer.removeView(mSubscriber!!.view) mSession!!.unsubscribe(mSubscriber) mSubscriber!!.destroy() mSubscriber = null } if (mPublisher != null) { - mPublisherViewContainer!!.removeView(mPublisher!!.view) + mPublisherViewContainer.removeView(mPublisher!!.view) mSession!!.unpublish(mPublisher) mPublisher!!.destroy() mPublisher = null @@ -482,6 +482,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session val res = if (isFullScreen) R.drawable.reducing else R.drawable.expand btnMinimize.setImageResource(res) setViewsVisibility() + + videoCallResponseListener?.minimizeVideoEvent(!isFullScreen) } private fun setViewsVisibility() { From c1ed1dc737fbdb27c0b5c2353a10296f0693d4b8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 16 Jun 2021 11:13:35 +0300 Subject: [PATCH 104/124] 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 5312c221d129d5a0200e7e8cb7b35800fa4e6014 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 16 Jun 2021 11:14:32 +0300 Subject: [PATCH 105/124] video fix bugs --- .../kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 03883361..1dc3d267 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -19,6 +19,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintSet import androidx.core.view.GestureDetectorCompat import androidx.fragment.app.DialogFragment +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel import com.hmg.hmgDr.Model.GetSessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.R @@ -358,7 +359,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } isConnected = true subscribeToStream(stream) -// videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) + videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) } override fun onStreamDropped(session: Session, stream: Stream) { @@ -433,7 +434,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } mSession!!.disconnect() countDownTimer?.cancel() -// videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) + videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) dialog?.dismiss() } @@ -589,7 +590,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } } - @SuppressLint("ClickableViewAccessibility") fun handleDragDialog() { mWindowManager = requireActivity().getSystemService(Context.WINDOW_SERVICE) as WindowManager From c1de90877749e897f4d456cf2825a96bd02452cf Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Wed, 16 Jun 2021 11:16:27 +0300 Subject: [PATCH 106/124] no message --- ios/Runner/Base.lproj/Main.storyboard | 161 +++++++++++--------- ios/Runner/Extensions.swift | 13 +- ios/Runner/MainAppViewController.swift | 30 ++-- ios/Runner/VideoCallRequestParameters.swift | 4 +- ios/Runner/VideoCallViewController.swift | 91 ++++++----- 5 files changed, 167 insertions(+), 132 deletions(-) diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index c1c16274..2bdee5a2 100755 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -41,18 +41,94 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -210,76 +286,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -300,23 +309,25 @@ + + + - - + diff --git a/ios/Runner/Extensions.swift b/ios/Runner/Extensions.swift index c73f49e2..b79c8deb 100644 --- a/ios/Runner/Extensions.swift +++ b/ios/Runner/Extensions.swift @@ -9,12 +9,19 @@ import AADraggableView extension AADraggableView{ func enable(_ enable:Bool){ - if enable == false{ + isEnabled = enable + if enable == false{ gestureRecognizers?.forEach({ gest in removeGestureRecognizer(gest) }) - }else{ - isEnabled = true } } } + +extension UIView{ + func hidden(_ hidden:Bool, rootView:UIView){ + UIView.transition(with: rootView, duration: 0.5, options: .transitionCrossDissolve, animations: { + self.isHidden = hidden + }) + } +} diff --git a/ios/Runner/MainAppViewController.swift b/ios/Runner/MainAppViewController.swift index ffca444c..c7b7a18d 100644 --- a/ios/Runner/MainAppViewController.swift +++ b/ios/Runner/MainAppViewController.swift @@ -72,9 +72,7 @@ extension MainAppViewController : ICallProtocol{ } private func showVideo(show:Bool){ - UIView.transition(with: view, duration: 0.5, options: .transitionCrossDissolve, animations: { - self.videoCallContainer.isHidden = !show - }) + self.videoCallContainer.hidden(!show, rootView: view) } private func startVideoCall(result: @escaping FlutterResult, call:FlutterMethodCall) { @@ -83,23 +81,19 @@ extension MainAppViewController : ICallProtocol{ if let arguments = call.arguments as? NSDictionary{ showVideoCallView(true) - videoCallViewController.onRectFloat = { min in - self.rectFloatVideoCallView(min) - if(min){ - self.videoCallContainer.repositionIfNeeded() - } + videoCallViewController.onRectFloat = { isRectFloat in + self.rectFloatVideoCallView(isRectFloat) } - videoCallViewController.onCircleFloat = { min in - self.circleFloatVideoCallView(min) - self.videoCallContainer.reposition = min ? .free : .edgesOnly - self.videoCallContainer.repositionIfNeeded() + videoCallViewController.onCircleFloat = { isCircleFloat in + self.circleFloatVideoCallView(isCircleFloat) } videoCallViewController.onCallConnect = { self.videoCallChannel?.invokeMethod("onCallConnected",arguments: nil) } videoCallViewController.onCallDisconnect = { self.showVideoCallView(false) + self.videoCallViewController.minimizeVideoState(state: false) self.videoCallChannel?.invokeMethod("onCallDisconnected",arguments: nil) } videoCallViewController.callBack = self @@ -130,7 +124,7 @@ extension MainAppViewController : ICallProtocol{ } private func circleFloatVideoCallView(_ value:Bool){ - videoCallContainer.enable(value) + videoCallContainer.reposition = value ? .sticky : .edgesOnly UIView.animate(withDuration: 0.5) { if(value){ @@ -152,9 +146,7 @@ extension MainAppViewController : ICallProtocol{ } private func showVideoCallView(_ value:Bool){ - UIView.animate(withDuration: 0.5) { - self.videoCallContainer.isHidden = !value - } + self.videoCallContainer.hidden(!value, rootView: view) } func sessionDone(res: Any) { @@ -182,14 +174,14 @@ extension MainAppViewController : ICallProtocol{ videoCallContainer.heightAnchor.constraint(equalToConstant: screen.height) ] vdoCallViewFloatRectConstraint = [ - videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor, constant: 20), + videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor, constant: 40), videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20), videoCallContainer.widthAnchor.constraint(equalToConstant: screen.width/3), videoCallContainer.heightAnchor.constraint(equalToConstant: screen.height/3.5) ] vdoCallViewFloatCircleConstraint = [ - videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor), - videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor), + videoCallContainer.topAnchor.constraint(equalTo: view.topAnchor, constant: 40), + videoCallContainer.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20), videoCallContainer.widthAnchor.constraint(equalToConstant: 70), videoCallContainer.heightAnchor.constraint(equalToConstant: 70) ] diff --git a/ios/Runner/VideoCallRequestParameters.swift b/ios/Runner/VideoCallRequestParameters.swift index 2366c562..543d7e8b 100644 --- a/ios/Runner/VideoCallRequestParameters.swift +++ b/ios/Runner/VideoCallRequestParameters.swift @@ -12,7 +12,8 @@ class VideoCallRequestParameters{ var generalId:String? var doctorId:Int? var baseUrl:String? - + var patientName:String? + init(dictionary:NSDictionary){ self.apiKey = dictionary["kApiKey"] as? String self.sessionId = dictionary["kSessionId"] as? String @@ -23,5 +24,6 @@ class VideoCallRequestParameters{ self.generalId = dictionary["generalId"] as? String self.doctorId = dictionary["DoctorId"] as? Int self.baseUrl = dictionary["baseUrl"] as? String + self.patientName = dictionary["patientName"] as? String } } diff --git a/ios/Runner/VideoCallViewController.swift b/ios/Runner/VideoCallViewController.swift index 02a70a0c..83865c6e 100644 --- a/ios/Runner/VideoCallViewController.swift +++ b/ios/Runner/VideoCallViewController.swift @@ -57,14 +57,15 @@ class VideoCallViewController: UIViewController { @IBOutlet weak var remoteVideoMutedIndicator: UIImageView! @IBOutlet weak var localVideoMutedBg: UIView! + @IBOutlet weak var btnScreenTap: UIButton! @IBOutlet weak var localVideoContainer: UIView! @IBOutlet weak var topBar: UIView! @IBOutlet weak var lblCallDuration: UILabel! - @IBOutlet weak var remoteVideo: UIView! - @IBOutlet weak var localVideo: UIView!{ + @IBOutlet weak var fullVideoView: UIView! + @IBOutlet weak var smallVideoView: UIView!{ didSet{ - localVideo.layer.borderColor = UIColor.white.cgColor - localVideoDraggable = localVideo?.superview as? AADraggableView + smallVideoView.layer.borderColor = UIColor.white.cgColor + localVideoDraggable = smallVideoView?.superview as? AADraggableView localVideoDraggable?.reposition = .edgesOnly } } @@ -78,16 +79,28 @@ class VideoCallViewController: UIViewController { gesture.view?.removeFromSuperview() } - @IBAction func onVideoContainerTapped(_ sender: Any) { + @IBAction func btnOnScreenTapped(_ sender: Any) { if(hideVideoBtn.isSelected){ circleFloatBtnTapped(hideVideoBtn) }else if(btnMinimize.isSelected){ btnMinimizeTapped(btnMinimize) - }else if(!btnMinimize.isSelected){ - // Swipe video here } } + + @IBAction func btnSwipeVideoTapped(_ sender: Any) { +// let smallVdoRender = smallVideoView.subviews.first +// let fullVdoRender = fullVideoView.subviews.first +// if let vdo = smallVdoRender{ +// fullVideoView.addSubview(vdo) +// } +// if let vdo = fullVdoRender{ +// smallVideoView.addSubview(vdo) +// } +// +// layoutVideoRenderViews() + } + @IBAction func didClickMuteButton(_ sender: UIButton) { sender.isSelected = !sender.isSelected publisher!.publishAudio = !sender.isSelected @@ -105,7 +118,7 @@ class VideoCallViewController: UIViewController { } else { publisher!.publishVideo = true } - localVideo.isHidden = sender.isSelected + smallVideoView.isHidden = sender.isSelected localVideoMutedBg.isHidden = !sender.isSelected } @@ -130,36 +143,41 @@ class VideoCallViewController: UIViewController { onCircleFloat?(sender.isSelected) topBar.isHidden = sender.isSelected controlButtons.isHidden = sender.isSelected - localVideo.isHidden = sender.isSelected + smallVideoView.isHidden = sender.isSelected self.publisher?.view?.layoutIfNeeded() } - var floated = false @IBAction func btnMinimizeTapped(_ sender: UIButton) { - floated = !floated - onRectFloat?(floated) - sender.isSelected = floated + minimizeVideoState(state: !sender.isSelected) + btnScreenTap.isHidden = !sender.isSelected + } + + func minimizeVideoState(state:Bool){ + btnMinimize.isSelected = state + onRectFloat?(state) - NSLayoutConstraint.activate(floated ? minimizeConstraint : maximisedConstraint) - NSLayoutConstraint.deactivate(floated ? maximisedConstraint : minimizeConstraint) - localVideoDraggable?.enable(!floated) + NSLayoutConstraint.activate(state ? minimizeConstraint : maximisedConstraint) + NSLayoutConstraint.deactivate(state ? maximisedConstraint : minimizeConstraint) + localVideoDraggable?.enable(!state) - lblRemoteUsername.isHidden = floated - hideVideoBtn.isHidden = !floated + lblRemoteUsername.isHidden = state + hideVideoBtn.isHidden = !state lblCallDuration.superview?.isHidden = !hideVideoBtn.isHidden - let min_ = floated UIView.animate(withDuration: 0.5) { - self.videoMuteBtn.isHidden = min_ - self.micMuteBtn.isHidden = min_ - self.camSwitchBtn.isHidden = min_ - - let localVdoSize = self.localVideo.bounds.size - let remoteVdoSize = self.remoteVideo.bounds.size - self.publisher?.view?.frame = CGRect(x: 0, y: 0, width: localVdoSize.width, height: localVdoSize.height) - self.subscriber?.view?.frame = CGRect(x: 0, y: 0, width: remoteVdoSize.width, height: remoteVdoSize.height) - self.publisher?.view?.layoutIfNeeded() - self.subscriber?.view?.layoutIfNeeded() + self.videoMuteBtn.isHidden = state + self.micMuteBtn.isHidden = state + self.camSwitchBtn.isHidden = state + self.layoutVideoRenderViews() + } + } + + func layoutVideoRenderViews(){ + if let publisherVdoSize = publisher?.view?.superview?.bounds.size{ + publisher?.view?.frame = CGRect(x: 0, y: 0, width: publisherVdoSize.width, height: publisherVdoSize.height) + } + if let subscriberVdoSize = subscriber?.view?.superview?.bounds.size{ + subscriber?.view?.frame = CGRect(x: 0, y: 0, width: subscriberVdoSize.width, height: subscriberVdoSize.height) } } @@ -179,6 +197,9 @@ class VideoCallViewController: UIViewController { } func start(params:VideoCallRequestParameters){ + lblRemoteUsername.text = params.patientName ?? "- - -" + btnScreenTap.isHidden = true + hideVideoBtn.isHidden = true self.kApiKey = params.apiKey ?? "" self.kSessionId = params.sessionId ?? "" @@ -193,6 +214,7 @@ class VideoCallViewController: UIViewController { requestCameraPermissionsIfNeeded() hideVideoMuted() setupSession() + } private func changeCallStatus(callStatus:Int){ @@ -397,10 +419,11 @@ extension VideoCallViewController: OTSessionDelegate { showAlert(error?.localizedDescription) } - publisher?.view!.frame = CGRect(x: 0, y: 0, width: localVideo.bounds.size.width, height: localVideo.bounds.size.height) + publisher?.view?.tag = 11 publisher?.view?.layer.cornerRadius = 5 publisher?.view?.clipsToBounds = true - localVideo.addSubview((publisher?.view)!) + smallVideoView.addSubview((publisher?.view)!) + layoutVideoRenderViews() } func sessionDidDisconnect(_ session: OTSession) { @@ -440,9 +463,9 @@ extension VideoCallViewController: OTSessionDelegate { guard let subscriberView = subscriber.view else { return } - - subscriberView.frame = CGRect(x: 0, y: 0, width: remoteVideo.bounds.width, height: remoteVideo.bounds.height) - remoteVideo.addSubview(subscriberView) + subscriberView.tag = 22 + fullVideoView.addSubview(subscriberView) + layoutVideoRenderViews() startUpdateCallDuration() onCallConnect?() From 0868de7961ab6053cd50e61216fd7b471498ef09 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 16 Jun 2021 14:05:04 +0300 Subject: [PATCH 107/124] video fix bugs --- android/app/src/main/AndroidManifest.xml | 1 - .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 28 +- .../com/hmg/hmgDr/ui/VideoCallActivity.java | 481 ------------------ .../hmg/hmgDr/ui/VideoCallResponseListener.kt | 2 + .../hmgDr/ui/fragment/VideoCallFragment.kt | 34 +- .../src/main/res/drawable/circle_shape.xml | 14 + .../main/res/drawable/layout_rounded_bg.xml | 14 +- 7 files changed, 64 insertions(+), 510 deletions(-) delete mode 100644 android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java create mode 100644 android/app/src/main/res/drawable/circle_shape.xml diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0e71249f..bf0d3766 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -27,7 +27,6 @@ android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:label="HMG Doctor"> - = HashMap() callResponse["callResponse"] = "CallEnd" @@ -166,5 +167,8 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, methodChannel.invokeMethod("onCallDisconnected", null) } + override fun onBackPressed() { + super.onBackPressed() + } } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java deleted file mode 100644 index 75590b76..00000000 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallActivity.java +++ /dev/null @@ -1,481 +0,0 @@ -package com.hmg.hmgDr.ui; - -import androidx.annotation.NonNull; -import androidx.appcompat.app.AppCompatActivity; - -import android.Manifest; -import android.annotation.SuppressLint; -import android.app.Activity; -import android.content.Intent; -import android.opengl.GLSurfaceView; -import android.os.Bundle; -import android.os.CountDownTimer; -import android.os.Handler; -import android.os.SystemClock; -import android.util.Log; -import android.view.View; -import android.widget.Chronometer; -import android.widget.FrameLayout; -import android.widget.ImageView; -import android.widget.ProgressBar; -import android.widget.RelativeLayout; -import android.widget.TextView; - -import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; -import com.hmg.hmgDr.Model.GetSessionStatusModel; -import com.hmg.hmgDr.Model.SessionStatusModel; -import com.hmg.hmgDr.R; -import com.opentok.android.Session; -import com.opentok.android.Stream; -import com.opentok.android.Publisher; -import com.opentok.android.PublisherKit; -import com.opentok.android.Subscriber; -import com.opentok.android.BaseVideoRenderer; -import com.opentok.android.OpentokError; -import com.opentok.android.SubscriberKit; - -import java.util.List; -import java.util.Objects; - -import pub.devrel.easypermissions.AfterPermissionGranted; -import pub.devrel.easypermissions.AppSettingsDialog; -import pub.devrel.easypermissions.EasyPermissions; - -public class VideoCallActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks, - Session.SessionListener, - Publisher.PublisherListener, - Subscriber.VideoListener, VideoCallContract.VideoCallView { - - private static final String TAG = VideoCallActivity.class.getSimpleName(); - - VideoCallContract.VideoCallPresenter videoCallPresenter; - - private static final int RC_SETTINGS_SCREEN_PERM = 123; - private static final int RC_VIDEO_APP_PERM = 124; - - - private Session mSession; - private Publisher mPublisher; - private Subscriber mSubscriber; - - private Handler mVolHandler, mConnectedHandler; - private Runnable mVolRunnable, mConnectedRunnable; - - private FrameLayout mPublisherViewContainer; - private FrameLayout mSubscriberViewContainer; - private RelativeLayout controlPanel; - - private String apiKey; - private String sessionId; - private String token; - private String appLang; - private String baseUrl; - - private boolean isSwitchCameraClicked; - private boolean isCameraClicked; - private boolean isSpeckerClicked; - private boolean isMicClicked; - - private TextView patientName; - private Chronometer cmTimer; - long elapsedTime; - Boolean resume = false; - - private ImageView mCallBtn; - private ImageView btnMinimize; - private ImageView mCameraBtn; - private ImageView mSwitchCameraBtn; - private ImageView mspeckerBtn; - private ImageView mMicBtn; - - private ProgressBar progressBar; - private CountDownTimer countDownTimer; - private TextView progressBarTextView; - private RelativeLayout progressBarLayout; - - private boolean isConnected = false; - - private GetSessionStatusModel sessionStatusModel; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(R.style.AppTheme); - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_video_call); - Objects.requireNonNull(getSupportActionBar()).hide(); - initUI(); - requestPermissions(); - } - - @Override - protected void onPause() { - super.onPause(); - - if (mSession == null) { - return; - } - mSession.onPause(); - - if (isFinishing()) { - disconnectSession(); - } - } - - @Override - protected void onResume() { - super.onResume(); - - if (mSession == null) { - return; - } - mSession.onResume(); - } - - @Override - protected void onDestroy() { - disconnectSession(); - cmTimer.stop(); - super.onDestroy(); - } - - @SuppressLint("ClickableViewAccessibility") - private void initUI() { - mPublisherViewContainer = findViewById(R.id.local_video_view_container); - mSubscriberViewContainer = findViewById(R.id.remote_video_view_container); - - apiKey = getIntent().getStringExtra("apiKey"); - sessionId = getIntent().getStringExtra("sessionId"); - token = getIntent().getStringExtra("token"); - appLang = getIntent().getStringExtra("appLang"); - baseUrl = getIntent().getStringExtra("baseUrl"); - sessionStatusModel = getIntent().getParcelableExtra("sessionStatusModel"); - - controlPanel = findViewById(R.id.control_panel); - - videoCallPresenter = new VideoCallPresenterImpl(this, baseUrl); - - patientName = findViewById(R.id.patient_name); - patientName.setText(sessionStatusModel.getPatientName()); - - cmTimer = findViewById(R.id.cmTimer); - cmTimer.setFormat("mm:ss"); - cmTimer.setOnChronometerTickListener(arg0 -> { - long minutes; - long seconds; - if (!resume) { - minutes = ((SystemClock.elapsedRealtime() - cmTimer.getBase()) / 1000) / 60; - seconds = ((SystemClock.elapsedRealtime() - cmTimer.getBase()) / 1000) % 60; - elapsedTime = SystemClock.elapsedRealtime(); - } else { - minutes = ((elapsedTime - cmTimer.getBase()) / 1000) / 60; - seconds = ((elapsedTime - cmTimer.getBase()) / 1000) % 60; - elapsedTime = elapsedTime + 1000; - } - Log.d(TAG, "onChronometerTick: " + minutes + " : " + seconds); - }); - - mCallBtn = findViewById(R.id.btn_call); - btnMinimize = findViewById(R.id.btn_minimize); - mCameraBtn = findViewById(R.id.btn_camera); - mSwitchCameraBtn = findViewById(R.id.btn_switch_camera); - mspeckerBtn = findViewById(R.id.btn_specker); - mMicBtn = findViewById(R.id.btn_mic); - - // progressBarLayout=findViewById(R.id.progressBar); - // progressBar=findViewById(R.id.progress_bar); -// progressBarTextView=findViewById(R.id.progress_bar_text); -// progressBar.setVisibility(View.GONE); - - hiddenButtons(); - - checkClientConnected(); - - mSubscriberViewContainer.setOnTouchListener((v, event) -> { - controlPanel.setVisibility(View.VISIBLE); - mVolHandler.removeCallbacks(mVolRunnable); - mVolHandler.postDelayed(mVolRunnable, 5 * 1000); - return true; - }); - - if (appLang.equals("ar")) { - progressBarLayout.setLayoutDirection(View.LAYOUT_DIRECTION_RTL); - } - - } - - private void checkClientConnected() { - mConnectedHandler = new Handler(); - mConnectedRunnable = () -> { - if (!isConnected) { - videoCallPresenter.callClintConnected(sessionStatusModel); - } - }; - mConnectedHandler.postDelayed(mConnectedRunnable, 55 * 1000); - - } - - private void hiddenButtons() { - mVolHandler = new Handler(); - mVolRunnable = () -> controlPanel.setVisibility(View.GONE); - mVolHandler.postDelayed(mVolRunnable, 5 * 1000); - } - - @Override - public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { - super.onRequestPermissionsResult(requestCode, permissions, grantResults); - - EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this); - } - - @Override - public void onPermissionsGranted(int requestCode, List perms) { - Log.d(TAG, "onPermissionsGranted:" + requestCode + ":" + perms.size()); - } - - @Override - public void onPermissionsDenied(int requestCode, List perms) { - Log.d(TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size()); - - if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) { - new AppSettingsDialog.Builder(this) - .setTitle(getString(R.string.title_settings_dialog)) - .setRationale(getString(R.string.rationale_ask_again)) - .setPositiveButton(getString(R.string.setting)) - .setNegativeButton(getString(R.string.cancel)) - .setRequestCode(RC_SETTINGS_SCREEN_PERM) - .build() - .show(); - } - } - - @AfterPermissionGranted(RC_VIDEO_APP_PERM) - private void requestPermissions() { - String[] perms = {Manifest.permission.INTERNET, Manifest.permission.CAMERA,}; - if (EasyPermissions.hasPermissions(this, perms)) { - try { - mSession = new Session.Builder(this, apiKey, sessionId).build(); - mSession.setSessionListener(this); - mSession.connect(token); - } catch (Exception e) { - e.printStackTrace(); - } - } else { - EasyPermissions.requestPermissions(this, getString(R.string.remaining_ar), RC_VIDEO_APP_PERM, perms); - } - } - - @Override - public void onConnected(Session session) { - Log.i(TAG, "Session Connected"); - - mPublisher = new Publisher.Builder(this).build(); - mPublisher.setPublisherListener(this); - - mPublisherViewContainer.addView(mPublisher.getView()); - - if (mPublisher.getView() instanceof GLSurfaceView) { - ((GLSurfaceView) mPublisher.getView()).setZOrderOnTop(true); - } - - mSession.publish(mPublisher); - - if (!resume) { - cmTimer.setBase(SystemClock.elapsedRealtime()); - } - cmTimer.start(); - } - - @Override - public void onDisconnected(Session session) { - Log.d(TAG, "onDisconnected: disconnected from session " + session.getSessionId()); - - mSession = null; - cmTimer.stop(); - } - - @Override - public void onError(Session session, OpentokError opentokError) { - Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in session " + session.getSessionId()); - - // Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show(); - //finish(); - } - - @Override - public void onStreamReceived(Session session, Stream stream) { - Log.d(TAG, "onStreamReceived: New stream " + stream.getStreamId() + " in session " + session.getSessionId()); - if (mSubscriber != null) { - isConnected = true; - return; - } - isConnected = true; - subscribeToStream(stream); - if(mConnectedHandler!=null && mConnectedRunnable!=null) - mConnectedHandler.removeCallbacks(mConnectedRunnable); - videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(3,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID())); - } - - @Override - public void onStreamDropped(Session session, Stream stream) { - Log.d(TAG, "onStreamDropped: Stream " + stream.getStreamId() + " dropped from session " + session.getSessionId()); - - if (mSubscriber == null) { - return; - } - - if (mSubscriber.getStream().equals(stream)) { - mSubscriberViewContainer.removeView(mSubscriber.getView()); - mSubscriber.destroy(); - mSubscriber = null; - } - disconnectSession(); - } - - @Override - public void onStreamCreated(PublisherKit publisherKit, Stream stream) { - Log.d(TAG, "onStreamCreated: Own stream " + stream.getStreamId() + " created"); - } - - @Override - public void onStreamDestroyed(PublisherKit publisherKit, Stream stream) { - Log.d(TAG, "onStreamDestroyed: Own stream " + stream.getStreamId() + " destroyed"); - } - - @Override - public void onError(PublisherKit publisherKit, OpentokError opentokError) { - Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in publisher"); - - // Toast.makeText(this, "onError: Error (" + opentokError.getMessage() + ") in publisher", Toast.LENGTH_LONG).show(); - // finish(); - } - - @Override - public void onVideoDataReceived(SubscriberKit subscriberKit) { - mSubscriber.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL); - mSubscriberViewContainer.addView(mSubscriber.getView()); - } - - @Override - public void onVideoDisabled(SubscriberKit subscriberKit, String s) { - - } - - @Override - public void onVideoEnabled(SubscriberKit subscriberKit, String s) { - - } - - @Override - public void onVideoDisableWarning(SubscriberKit subscriberKit) { - - } - - @Override - public void onVideoDisableWarningLifted(SubscriberKit subscriberKit) { - - } - - private void subscribeToStream(Stream stream) { - mSubscriber = new Subscriber.Builder(VideoCallActivity.this, stream).build(); - mSubscriber.setVideoListener(this); - mSession.subscribe(mSubscriber); - } - - private void disconnectSession() { - if (mSession == null) { - setResult(Activity.RESULT_CANCELED); - finish(); - return; - } - - if (mSubscriber != null) { - mSubscriberViewContainer.removeView(mSubscriber.getView()); - mSession.unsubscribe(mSubscriber); - mSubscriber.destroy(); - mSubscriber = null; - } - - if (mPublisher != null) { - mPublisherViewContainer.removeView(mPublisher.getView()); - mSession.unpublish(mPublisher); - mPublisher.destroy(); - mPublisher = null; - } - mSession.disconnect(); - if (countDownTimer != null) { - countDownTimer.cancel(); - } - videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(16,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID())); - finish(); - } - - public void onSwitchCameraClicked(View view) { - if (mPublisher != null) { - isSwitchCameraClicked = !isSwitchCameraClicked; - mPublisher.cycleCamera(); - int res = isSwitchCameraClicked ? R.drawable.camera_front : R.drawable.camera_back; - mSwitchCameraBtn.setImageResource(res); - } - } - - public void onCallClicked(View view) { - disconnectSession(); - } - - public void onMinimizedClicked(View view) { - - } - - public void onCameraClicked(View view) { - if (mPublisher != null) { - isCameraClicked = !isCameraClicked; - mPublisher.setPublishVideo(!isCameraClicked); - int res = isCameraClicked ? R.drawable.video_disabled : R.drawable.video_enabled; - mCameraBtn.setImageResource(res); - } - } - - public void onMicClicked(View view) { - - if (mPublisher != null) { - isMicClicked = !isMicClicked; - mPublisher.setPublishAudio(!isMicClicked); - int res = isMicClicked ? R.drawable.mic_disabled : R.drawable.mic_enabled; - mMicBtn.setImageResource(res); - } - } - - public void onSpeckerClicked(View view) { - if (mSubscriber != null) { - isSpeckerClicked = !isSpeckerClicked; - mSubscriber.setSubscribeToAudio(!isSpeckerClicked); - int res = isSpeckerClicked ? R.drawable.audio_disabled : R.drawable.audio_enabled; - mspeckerBtn.setImageResource(res); - } - } - - @Override - public void onCallSuccessful(SessionStatusModel sessionStatusModel) { - if (sessionStatusModel.getSessionStatus() == 2 || sessionStatusModel.getSessionStatus() == 3) { - Intent returnIntent = new Intent(); - returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel); - setResult(Activity.RESULT_OK, returnIntent); - finish(); - } else if( sessionStatusModel.getSessionStatus() == 4 ){ - isConnected = true; - if(mConnectedHandler!=null && mConnectedRunnable!=null) - mConnectedHandler.removeCallbacks(mConnectedRunnable); - } - } - - @Override - public void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel) { - - } - - @Override - public void onFailure() { - - } -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt index eceed01e..204568a4 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallResponseListener.kt @@ -9,4 +9,6 @@ interface VideoCallResponseListener { fun errorHandle(message: String) fun minimizeVideoEvent(isMinimize : Boolean) + + fun onBackHandle(){} } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 1dc3d267..f7e6c4b2 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -16,7 +16,6 @@ import android.view.* import android.widget.* import androidx.annotation.Nullable import androidx.constraintlayout.widget.ConstraintLayout -import androidx.constraintlayout.widget.ConstraintSet import androidx.core.view.GestureDetectorCompat import androidx.fragment.app.DialogFragment import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel @@ -39,7 +38,7 @@ import kotlin.math.ceil class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.SessionListener, PublisherListener, SubscriberKit.VideoListener, VideoCallView { - var isFullScreen: Boolean = true + private var isFullScreen: Boolean = true private var x_init_cord = 0 private var y_init_cord: Int = 0 private var x_init_margin: Int = 0 @@ -48,7 +47,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private lateinit var mWindowManager: WindowManager private var isLeft = true - lateinit var videoCallPresenter: VideoCallPresenter + private lateinit var videoCallPresenter: VideoCallPresenter private var mSession: Session? = null private var mPublisher: Publisher? = null @@ -88,8 +87,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private lateinit var patientName: TextView private lateinit var cmTimer: Chronometer - var elapsedTime: Long = 0 - var resume = false + private var elapsedTime: Long = 0 + private var resume = false private val progressBar: ProgressBar? = null private val countDownTimer: CountDownTimer? = null @@ -122,6 +121,18 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog { val dialog: Dialog = super.onCreateDialog(savedInstanceState) + + // Add back button listener + // Add back button listener + dialog.setOnKeyListener { _, keyCode, keyEvent -> + // getAction to make sure this doesn't double fire + if (keyCode == KeyEvent.KEYCODE_BACK && keyEvent.action == KeyEvent.ACTION_UP) { + videoCallResponseListener?.onBackHandle() + false // Capture onKey + } else true + // Don't capture + } + return dialog } @@ -438,7 +449,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session dialog?.dismiss() } - override fun onCallSuccessful(sessionStatusModel: SessionStatusModel) { if (sessionStatusModel.sessionStatus == 2 || sessionStatusModel.sessionStatus == 3) { val returnIntent = Intent() @@ -523,7 +533,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session //// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidth, localPreviewHeight) localPreviewLayoutParam.width = localPreviewWidth localPreviewLayoutParam.height = localPreviewHeight - localPreviewLayoutParam.setMargins(0,localPreviewMargin, localPreviewMargin, 0) + localPreviewLayoutParam.setMargins(0, localPreviewMargin, localPreviewMargin, 0) // remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSize, remotePreviewIconSize) remotePreviewLayoutParam.width = remotePreviewIconSize remotePreviewLayoutParam.height = remotePreviewIconSize @@ -544,7 +554,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session localPreviewLayoutParam.width = 0 localPreviewLayoutParam.height = 0 - localPreviewLayoutParam.setMargins(0,localPreviewMargin / 2, localPreviewMargin/ 2, 0) + localPreviewLayoutParam.setMargins(0, localPreviewMargin / 2, localPreviewMargin / 2, 0) // localPreviewLayoutIconParam = FrameLayout.LayoutParams(localPreviewIconSmall, localPreviewIconSmall) //// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidthSmall, localPreviewHeightSmall) // localPreviewLayoutParam.width = localPreviewWidthSmall @@ -591,7 +601,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } @SuppressLint("ClickableViewAccessibility") - fun handleDragDialog() { + private fun handleDragDialog() { mWindowManager = requireActivity().getSystemService(Context.WINDOW_SERVICE) as WindowManager getWindowManagerDefaultDisplay() @@ -600,7 +610,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } @SuppressLint("ClickableViewAccessibility") - val dragListener: View.OnTouchListener = View.OnTouchListener { _, event -> + private val dragListener: View.OnTouchListener = View.OnTouchListener { _, event -> mDetector.onTouchEvent(event) //Get Floating widget view params @@ -631,10 +641,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session // y_cord_Destination = 0 // y_cord_Destination = // -(szWindow.y - (videoCallContainer.height /*+ barHeight*/)) - y_cord_Destination = - (szWindow.y/2) + y_cord_Destination = -(szWindow.y / 2) } else if (y_cord_Destination + (videoCallContainer.height + barHeight) > szWindow.y) { // y_cord_Destination = szWindow.y - (videoCallContainer.height + barHeight) - y_cord_Destination = (szWindow.y/2) + y_cord_Destination = (szWindow.y / 2) } layoutParams.y = y_cord_Destination diff --git a/android/app/src/main/res/drawable/circle_shape.xml b/android/app/src/main/res/drawable/circle_shape.xml new file mode 100644 index 00000000..2cb09469 --- /dev/null +++ b/android/app/src/main/res/drawable/circle_shape.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/layout_rounded_bg.xml b/android/app/src/main/res/drawable/layout_rounded_bg.xml index 0c46f49b..ce73e763 100644 --- a/android/app/src/main/res/drawable/layout_rounded_bg.xml +++ b/android/app/src/main/res/drawable/layout_rounded_bg.xml @@ -1,7 +1,13 @@ - - - - + + + + From 746f44157ed9f20db0b991b96b70c6cd4d22f706 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 16 Jun 2021 14:54:10 +0300 Subject: [PATCH 108/124] Add video call service --- .../hmgDr/ui/fragment/VideoCallFragment.kt | 2 + lib/core/service/NavigationService.dart | 10 +- lib/core/service/VideoCallService.dart | 88 +++++++++++++++ lib/landing_page.dart | 3 +- lib/locator.dart | 2 + lib/routes.dart | 3 + lib/screens/live_care/end_call_screen.dart | 44 +++++--- .../patient_profile_screen.dart | 102 ++++++++++-------- .../profile/patient-profile-app-bar.dart | 9 +- lib/widgets/shared/app_scaffold_widget.dart | 8 +- 10 files changed, 203 insertions(+), 68 deletions(-) create mode 100644 lib/core/service/VideoCallService.dart diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index f7e6c4b2..9a2deab6 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -370,6 +370,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } isConnected = true subscribeToStream(stream) + if (mConnectedHandler != null && mConnectedRunnable != null) + mConnectedHandler!!.removeCallbacks(mConnectedRunnable!!) videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) } diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 426ace4d..26191ffc 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -3,9 +3,15 @@ import 'package:flutter/material.dart'; class NavigationService { final GlobalKey navigatorKey = new GlobalKey(); - Future navigateTo(String routeName) { - return navigatorKey.currentState.pushNamed(routeName); + Future navigateTo(String routeName,{Object arguments}) { + return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); } + + Future pushReplacementNamed(String routeName,{Object arguments}) { + return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments); + } + + Future pushNamedAndRemoveUntil(String routeName) { return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); } diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart new file mode 100644 index 00000000..af832aad --- /dev/null +++ b/lib/core/service/VideoCallService.dart @@ -0,0 +1,88 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/VideoChannel.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/cupertino.dart'; + +import '../../locator.dart'; +import '../../routes.dart'; +import 'NavigationService.dart'; + +class VideoCallService extends BaseService{ + + StartCallRes startCallRes; + PatiantInformtion patient; + LiveCarePatientServices _liveCarePatientServices = locator(); + + openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{ + this.startCallRes = startModel; + this.patient = patientModel; + DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); + await VideoChannel.openVideoCallScreen( + kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//startCallRes.openTokenID, + kSessionId: "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",//startCallRes.openSessionID, + kApiKey: '47247954',//'46209962', + vcId: patient.vcId, + patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), + tokenID: await sharedPref.getString(TOKEN), + generalId: GENERAL_ID, + doctorId: doctorProfile.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + },onCallConnected: onCallConnected, + onCallEnd: () { + WidgetsBinding.instance.addPostFrameCallback((_) async { + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext); + endCall(patient.vcId, false,).then((value) { + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext); + if (hasError) { + DrAppToastMsg.showErrorToast(error); + }else + locator().navigateTo(PATIENTS_END_Call,arguments: { + "patient": patient, + }); + + }); + }); + }, + onCallNotRespond: (SessionStatusModel sessionStatusModel) { + WidgetsBinding.instance.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext); + endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { + GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext); + if (hasError) { + DrAppToastMsg.showErrorToast(error); + } else { + locator().navigateTo(PATIENTS_END_Call,arguments: { + "patient": patient, + }); + } + + }); + + }); + }); + } + Future endCall(int vCID, bool isPatient) async { + hasError = false; + // await getDoctorProfile(isGetProfile: true); + EndCallReq endCallReq = new EndCallReq(); + endCallReq.doctorId = doctorProfile.doctorID; + endCallReq.generalid = 'Cs2020@2016\$2958'; + endCallReq.vCID = vCID; + endCallReq.isDestroy = isPatient; + //await _liveCarePatientServices.endCall(endCallReq); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + } + } + +} \ No newline at end of file diff --git a/lib/landing_page.dart b/lib/landing_page.dart index cd7a8171..5bce4f71 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/screens/home/home_screen.dart'; import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -33,7 +34,7 @@ class _LandingPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( + return AppScaffold( appBar: currentTab != 0 ? AppBar( elevation: 0, diff --git a/lib/locator.dart b/lib/locator.dart index 1e4bcb4c..d74fad8b 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; import 'core/service/NavigationService.dart'; +import 'core/service/VideoCallService.dart'; import 'core/service/home/dasboard_service.dart'; import 'core/service/home/doctor_reply_service.dart'; import 'core/service/home/schedule_service.dart'; @@ -96,6 +97,7 @@ void setupLocator() { locator.registerLazySingleton(() => NavigationService()); locator.registerLazySingleton(() => ScanQrService()); locator.registerLazySingleton(() => SpecialClinicsService()); + locator.registerLazySingleton(() => VideoCallService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/routes.dart b/lib/routes.dart index 33aa5636..0826c76e 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/root_page.dart'; +import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; @@ -37,6 +38,7 @@ const String LOGIN = 'login'; const String VERIFICATION_METHODS = 'verification-methods'; const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; +const String PATIENTS_END_Call = 'patients/patients-profile/endCall'; const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String LAB_RESULT = 'patients/lab_result'; const String HEALTH_SUMMARY = 'patients/health-summary'; @@ -88,6 +90,7 @@ var routes = { PATIENT_MEDICAL_REPORT: (_) => MedicalReportPage(), PATIENT_MEDICAL_REPORT_INSERT: (_) => AddVerifyMedicalReport(), PATIENT_MEDICAL_REPORT_DETAIL: (_) => MedicalReportDetailPage(), + PATIENTS_END_Call: (_) => EndCallScreen(), CREATE_EPISODE: (_) => UpdateSoapIndex( isUpdate: true, ), diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 76e87a87..d355473d 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -23,9 +23,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { - final PatiantInformtion patient; - const EndCallScreen({Key key, this.patient}) : super(key: key); + + const EndCallScreen({Key key,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -33,7 +33,7 @@ class EndCallScreen extends StatefulWidget { class _EndCallScreenState extends State { bool isInpatient = false; - + PatiantInformtion patient; bool isDischargedPatient = false; bool isSearchAndOut = false; String patientType; @@ -43,6 +43,13 @@ class _EndCallScreenState extends State { LiveCarePatientViewModel liveCareModel; + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + } + @override Widget build(BuildContext context) { final List cardsList = [ @@ -53,7 +60,7 @@ class _EndCallScreenState extends State { onTap: () async { GifLoaderDialogUtils.showMyDialog(context); await liveCareModel - .startCall(isReCall: false, vCID: widget.patient.vcId) + .startCall(isReCall: false, vCID: patient.vcId) .then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); @@ -64,8 +71,8 @@ class _EndCallScreenState extends State { kToken: liveCareModel.startCallRes.openTokenID, kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', - vcId: widget.patient.vcId, - patientName: widget.patient.fullName ?? (widget.patient.firstName != null ? "${widget.patient.firstName} ${widget.patient.lastName}" : "-"), + vcId: patient.vcId, + patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, doctorId: liveCareModel.doctorProfile.doctorID, @@ -76,7 +83,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - widget.patient.vcId, + patient.vcId, false, ); GifLoaderDialogUtils.hideDialog(context); @@ -89,7 +96,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - widget.patient.vcId, + patient.vcId, sessionStatusModel.sessionStatus == 3, ); GifLoaderDialogUtils.hideDialog(context); @@ -116,14 +123,14 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.getAlternativeServices(widget.patient.vcId); + await liveCareModel.getAlternativeServices(patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCallWithCharge(widget.patient.vcId, isConfirmed); + await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -147,7 +154,7 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.sendSMSInstruction(widget.patient.vcId); + await liveCareModel.sendSMSInstruction(patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -169,7 +176,7 @@ class _EndCallScreenState extends State { context, MaterialPageRoute( builder: (BuildContext context) => - LivaCareTransferToAdmin(patient: widget.patient))); + LivaCareTransferToAdmin(patient: patient))); }, isInPatient: isInpatient, isDartIcon: true, @@ -186,10 +193,14 @@ class _EndCallScreenState extends State { backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, appBar: PatientProfileAppBar( - widget.patient, + patient, + onPressed: (){ + Navigator.pop(context); + + }, isInpatient: isInpatient, - height: (widget.patient.patientStatusType != null && - widget.patient.patientStatusType == 43) + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -232,7 +243,7 @@ class _EndCallScreenState extends State { staggeredTileBuilder: (int index) => StaggeredTile.fit(1), itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: widget.patient, + patient: patient, patientType: patientType, arrivalType: arrivalType, from: from, @@ -331,6 +342,7 @@ class _EndCallScreenState extends State { ), AppButton( onPressed: () { + Navigator.of(context).pop(); Navigator.of(context).pop(); okFunction(false); }, diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index d755af4a..9aa95d16 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; @@ -25,6 +26,7 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:quiver/async.dart'; +import '../../../../locator.dart'; import '../../../../routes.dart'; class PatientProfileScreen extends StatefulWidget { @@ -91,6 +93,9 @@ class _PatientProfileScreenState extends State if(routeArgs.containsKey("isFromLiveCare")) { isFromLiveCare = routeArgs['isFromLiveCare']; } + if(routeArgs.containsKey("isCallFinished")) { + isCallFinished = routeArgs['isCallFinished']; + } if (isInpatient) _activeTab = 0; else @@ -333,9 +338,9 @@ class _PatientProfileScreenState extends State if(isCallFinished) { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - EndCallScreen(patient:patient))); + // Navigator.push(context, MaterialPageRoute( + // builder: (BuildContext context) => EndCallScreen(patient:patient))); + var asd = ""; } else { GifLoaderDialogUtils.showMyDialog(context); // await model.startCall( isReCall : false, vCID: patient.vcId); @@ -349,49 +354,54 @@ class _PatientProfileScreenState extends State patient.episodeNo = 0; GifLoaderDialogUtils.hideDialog(context); - await VideoChannel.openVideoCallScreen( - kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID, - kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",// model.startCallRes.openSessionID, - kApiKey: '47247954',//46209962 - vcId: patient.vcId, - patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), - tokenID: await model.getToken(), - generalId: GENERAL_ID, - doctorId: model.doctorProfile.doctorID, - onFailure: (String error) { - DrAppToastMsg.showErrorToast(error); - },onCallConnected: callConnected, - onCallEnd: () { - var asd=""; - // WidgetsBinding.instance.addPostFrameCallback((_) { - // GifLoaderDialogUtils.showMyDialog(context); - // model.endCall(patient.vcId, false,).then((value) { - // GifLoaderDialogUtils.hideDialog(context); - // if (model.state == ViewState.ErrorLocal) { - // DrAppToastMsg.showErrorToast(model.error); - // } - // setState(() { - // isCallFinished = true; - // }); - // }); - // }); - }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) { - var asd=""; - // WidgetsBinding.instance.addPostFrameCallback((_) { - // GifLoaderDialogUtils.showMyDialog(context); - // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - // GifLoaderDialogUtils.hideDialog(context); - // if (model.state == ViewState.ErrorLocal) { - // DrAppToastMsg.showErrorToast(model.error); - // } - // setState(() { - // isCallFinished = true; - // }); - // }); - // - // }); - }); + locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); + + // await VideoChannel.openVideoCallScreen( + // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID, + // kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",// model.startCallRes.openSessionID, + // kApiKey: '47247954',//46209962 + // vcId: patient.vcId, + // patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), + // tokenID: await model.getToken(), + // generalId: GENERAL_ID, + // doctorId: model.doctorProfile.doctorID, + // onFailure: (String error) { + // DrAppToastMsg.showErrorToast(error); + // },onCallConnected: callConnected, + // onCallEnd: () { + // var asd=""; + // WidgetsBinding.instance.addPostFrameCallback((_) { + // GifLoaderDialogUtils.showMyDialog(context); + // model.endCall(patient.vcId, false,).then((value) { + // GifLoaderDialogUtils.hideDialog(context); + // if (model.state == ViewState.ErrorLocal) { + // DrAppToastMsg.showErrorToast(model.error); + // } + // setState(() { + // isCallFinished = true; + // }); + // }); + // }); + // Navigator.push(context, MaterialPageRoute( + // builder: (BuildContext context) => + // EndCallScreen(patient:patient))); + // }, + // onCallNotRespond: (SessionStatusModel sessionStatusModel) { + // var asd=""; + // // WidgetsBinding.instance.addPostFrameCallback((_) { + // // GifLoaderDialogUtils.showMyDialog(context); + // // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { + // // GifLoaderDialogUtils.hideDialog(context); + // // if (model.state == ViewState.ErrorLocal) { + // // DrAppToastMsg.showErrorToast(model.error); + // // } + // // setState(() { + // // isCallFinished = true; + // // }); + // // }); + // // + // // }); + // }); } } diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 5cfdc1b6..de374f04 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -33,6 +33,7 @@ class PatientProfileAppBar extends StatelessWidget final String clinic; final bool isAppointmentHeader; final bool isFromLabResult; + final VoidCallback onPressed; PatientProfileAppBar( this.patient, @@ -52,7 +53,7 @@ class PatientProfileAppBar extends StatelessWidget this.episode, this.visitDate, this.isAppointmentHeader = false, - this.isFromLabResult = false}); + this.isFromLabResult = false, this.onPressed}); @override @@ -93,7 +94,11 @@ class PatientProfileAppBar extends StatelessWidget IconButton( icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, - onPressed: () => Navigator.pop(context), + onPressed: () { + if(onPressed!=null) + onPressed(); + Navigator.pop(context); + }, ), Expanded( child: AppText( diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e957b5d4..b930c21a 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -19,8 +19,11 @@ class AppScaffold extends StatelessWidget { final Widget bottomSheet; final Color backgroundColor; final Widget appBar; + final Widget drawer; + final Widget bottomNavigationBar; final String subtitle; final bool isHomeIcon; + final bool extendBody; AppScaffold( {this.appBarTitle = '', this.body, @@ -30,7 +33,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle}); + this.appBar, this.subtitle, this.drawer, this.extendBody = false, this.bottomNavigationBar}); @override Widget build(BuildContext context) { @@ -42,6 +45,9 @@ class AppScaffold extends StatelessWidget { }, child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, + drawer: drawer, + extendBody: extendBody, + bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar ? appBar ?? AppBar( From 7614b4aa5c7406da5c3c209f6057e65c04ca8661 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 16 Jun 2021 15:12:25 +0300 Subject: [PATCH 109/124] fix the video call issues --- lib/config/config.dart | 4 ++-- lib/core/service/VideoCallService.dart | 10 +++++----- lib/core/viewModel/authentication_view_model.dart | 2 +- lib/screens/home/home_screen.dart | 2 +- lib/screens/patients/PatientsInPatientScreen.dart | 13 ++++++------- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index eb361798..8241b36c 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/VideoCallService.dart b/lib/core/service/VideoCallService.dart index af832aad..0ae61a55 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//startCallRes.openTokenID, - kSessionId: "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",//startCallRes.openSessionID, - kApiKey: '47247954',//'46209962', + kToken: startCallRes.openTokenID, + kSessionId: startCallRes.openSessionID, + kApiKey: '46209962',//'46209962', vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), @@ -73,13 +73,13 @@ class VideoCallService extends BaseService{ } Future endCall(int vCID, bool isPatient) async { hasError = false; - // await getDoctorProfile(isGetProfile: true); + await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); endCallReq.doctorId = doctorProfile.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; - //await _liveCarePatientServices.endCall(endCallReq); + await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; } diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 189dea42..9da1933a 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -255,7 +255,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index aaf4d9b9..d448083f 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -69,7 +69,7 @@ class _HomeScreenState extends State { await model.getDashboard(); await model.getDoctorProfile(isGetProfile: true); await model.checkDoctorHasLiveCare(); - await model.getSpecialClinicalCareList(); + // await model.getSpecialClinicalCareList(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 4971b636..ae0fbb59 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -65,13 +65,12 @@ class _PatientInPatientScreenState extends State return BaseView( onModelReady: (model) async { model.clearPatientList(); - if (widget.specialClinic != null) { - await model - .getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); - requestModel.nursingStationID = - model.specialClinicalCareMappingList[0].nursingStationID; - requestModel.clinicID = 0; - } + // 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) => From 78903043d95aa89cc135ee4dbf0788bbadfbc3d7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 16 Jun 2021 16:18:54 +0300 Subject: [PATCH 110/124] 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 111/124] 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 112/124] 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" From edca552f789024cae097bb67b91056776225459e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 16 Jun 2021 17:18:12 +0300 Subject: [PATCH 113/124] video fix bugs --- .../hmgDr/ui/fragment/VideoCallFragment.kt | 62 ++++++++++++++++++- .../src/main/res/drawable/circle_shape.xml | 6 +- android/app/src/main/res/drawable/ic_mini.xml | 5 ++ .../main/res/layout/activity_video_call.xml | 22 ++++++- android/app/src/main/res/values/colors.xml | 4 ++ lib/config/config.dart | 4 +- lib/core/service/VideoCallService.dart | 6 +- 7 files changed, 98 insertions(+), 11 deletions(-) create mode 100644 android/app/src/main/res/drawable/ic_mini.xml diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 9a2deab6..68db00fb 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -16,6 +16,7 @@ import android.view.* import android.widget.* import androidx.annotation.Nullable import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.content.ContextCompat import androidx.core.view.GestureDetectorCompat import androidx.fragment.app.DialogFragment import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel @@ -39,6 +40,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session SubscriberKit.VideoListener, VideoCallView { private var isFullScreen: Boolean = true + private var isCircle: Boolean = false private var x_init_cord = 0 private var y_init_cord: Int = 0 private var x_init_margin: Int = 0 @@ -78,6 +80,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private lateinit var parentView: View private lateinit var videoCallContainer: ConstraintLayout private lateinit var layoutName: RelativeLayout + private lateinit var layoutMini: RelativeLayout + private lateinit var icMini: ImageButton private lateinit var mCallBtn: ImageView private lateinit var btnMinimize: ImageView private lateinit var mCameraBtn: ImageView @@ -179,7 +183,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session requestPermissions() handleDragDialog() - mDetector = GestureDetectorCompat(context, MyGestureListener { showControlPanelTemporarily() }) + mDetector = GestureDetectorCompat(context, MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() })) return parentView } @@ -214,6 +218,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private fun initUI(view: View) { videoCallContainer = view.findViewById(R.id.video_call_ll) layoutName = view.findViewById(R.id.layout_name) + layoutMini = view.findViewById(R.id.layout_mini) + icMini = view.findViewById(R.id.ic_mini) mPublisherViewContainer = view.findViewById(R.id.local_video_view_container) mPublisherViewIcon = view.findViewById(R.id.local_video_view_icon) mSubscriberViewIcon = view.findViewById(R.id.remote_video_view_icon) @@ -240,6 +246,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session Log.d(VideoCallFragment.TAG, "onChronometerTick: $minutes : $seconds") } + icMini.setOnClickListener { + onMiniCircleClicked() + } + controlPanel = view.findViewById(R.id.control_panel) videoCallPresenter = VideoCallPresenterImpl(this, baseUrl) mCallBtn = view.findViewById(R.id.btn_call) @@ -478,6 +488,39 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session disconnectSession() } + private fun miniCircleDoubleTap(){ + if (isCircle){ + onMiniCircleClicked() + } + } + + private fun onMiniCircleClicked(){ + if (isCircle) { + dialog?.window?.setLayout( + 400, + 600 + ) + videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) + mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground)) + } else { + dialog?.window?.setLayout( + 200, + 200 + ) + videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) + mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) + } + isCircle = !isCircle + + if(isCircle){ + controlPanel?.visibility = View.GONE + layoutMini.visibility = View.GONE + } else { + controlPanel?.visibility = View.VISIBLE + layoutMini.visibility = View.VISIBLE + } + } + private fun onMinimizedClicked(view: View?) { if (isFullScreen) { dialog?.window?.setLayout( @@ -522,6 +565,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session if (isFullScreen) { layoutName.visibility = View.VISIBLE + layoutMini.visibility = View.GONE mCameraBtn.visibility = View.VISIBLE mSwitchCameraBtn.visibility = View.VISIBLE // mspeckerBtn.visibility = View.VISIBLE @@ -541,6 +585,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session remotePreviewLayoutParam.height = remotePreviewIconSize } else { layoutName.visibility = View.GONE + layoutMini.visibility = View.VISIBLE mCameraBtn.visibility = View.GONE mSwitchCameraBtn.visibility = View.GONE // mspeckerBtn.visibility = View.GONE @@ -565,6 +610,14 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session // remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSizeSmall, remotePreviewIconSizeSmall) remotePreviewLayoutParam.width = remotePreviewIconSizeSmall remotePreviewLayoutParam.height = remotePreviewIconSizeSmall + + if(isCircle){ + controlPanel?.visibility = View.GONE + layoutMini.visibility = View.GONE + } else { + controlPanel?.visibility = View.VISIBLE + layoutMini.visibility = View.VISIBLE + } } mPublisherViewContainer.layoutParams = localPreviewLayoutParam @@ -753,13 +806,18 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session ).toInt() } - private class MyGestureListener(val onTabCall: () -> Unit) : GestureDetector.SimpleOnGestureListener() { + private class MyGestureListener(val onTabCall: () -> Unit, val miniCircleDoubleTap: () -> Unit) : GestureDetector.SimpleOnGestureListener() { override fun onSingleTapConfirmed(event: MotionEvent): Boolean { onTabCall() return true } + override fun onDoubleTap(e: MotionEvent?): Boolean { + miniCircleDoubleTap() + return super.onDoubleTap(e) + } + } companion object { diff --git a/android/app/src/main/res/drawable/circle_shape.xml b/android/app/src/main/res/drawable/circle_shape.xml index 2cb09469..27b49f9b 100644 --- a/android/app/src/main/res/drawable/circle_shape.xml +++ b/android/app/src/main/res/drawable/circle_shape.xml @@ -3,10 +3,10 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> - - + - + + + diff --git a/android/app/src/main/res/layout/activity_video_call.xml b/android/app/src/main/res/layout/activity_video_call.xml index 6dbdaa1f..efc97746 100644 --- a/android/app/src/main/res/layout/activity_video_call.xml +++ b/android/app/src/main/res/layout/activity_video_call.xml @@ -47,12 +47,32 @@ + + + + + diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml index 29782be0..f52c2cf2 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/app/src/main/res/values/colors.xml @@ -5,6 +5,10 @@ #fc3850 #e4e9f2 + #80757575 + #00ffffff + + #827b92 #484258 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/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 0ae61a55..114d627f 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: startCallRes.openTokenID, - kSessionId: startCallRes.openSessionID, - kApiKey: '46209962',//'46209962', + kToken:"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", //startCallRes.openTokenID, + kSessionId: "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",//startCallRes.openSessionID, + kApiKey:'47247954',// '46209962', vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), From b8de9c9a14f98e41e90264e437c6533d6690bcf3 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Jun 2021 10:11:19 +0300 Subject: [PATCH 114/124] circle screen fix bug, and mini screen design --- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 6 ++- .../hmgDr/ui/fragment/VideoCallFragment.kt | 28 +++++----- android/app/src/main/res/drawable/ic_mini.xml | 2 +- .../main/res/layout/activity_video_call.xml | 53 +++++++++---------- 4 files changed, 47 insertions(+), 42 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index af19306d..fcc3f2e3 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -151,7 +151,11 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, } else if (resultCode == Activity.RESULT_CANCELED) { val callResponse: HashMap = HashMap() callResponse["callResponse"] = "CallEnd" - result?.success(callResponse) + try { + result?.success(callResponse) + } catch (e : Exception){ + Log.e("onVideoCallFinished", "${e.message}.") + } } } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 68db00fb..51ce1948 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -64,7 +64,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private lateinit var mPublisherViewIcon: View private lateinit var mSubscriberViewContainer: FrameLayout private lateinit var mSubscriberViewIcon: ImageView - private var controlPanel: ConstraintLayout? = null + private lateinit var controlPanel: ConstraintLayout private var apiKey: String? = null private var sessionId: String? = null @@ -300,7 +300,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private fun hiddenButtons() { mVolHandler = Handler() - mVolRunnable = Runnable { controlPanel!!.visibility = View.GONE } + mVolRunnable = Runnable { controlPanel.visibility = View.GONE } mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) } @@ -496,27 +496,27 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private fun onMiniCircleClicked(){ if (isCircle) { + videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) + mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground)) dialog?.window?.setLayout( 400, 600 ) - videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) - mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground)) } else { + videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) + mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) dialog?.window?.setLayout( 200, 200 ) - videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) - mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) } isCircle = !isCircle if(isCircle){ - controlPanel?.visibility = View.GONE + controlPanel.visibility = View.GONE layoutMini.visibility = View.GONE } else { - controlPanel?.visibility = View.VISIBLE + controlPanel.visibility = View.VISIBLE layoutMini.visibility = View.VISIBLE } } @@ -612,10 +612,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session remotePreviewLayoutParam.height = remotePreviewIconSizeSmall if(isCircle){ - controlPanel?.visibility = View.GONE + controlPanel.visibility = View.GONE layoutMini.visibility = View.GONE } else { - controlPanel?.visibility = View.VISIBLE + controlPanel.visibility = View.VISIBLE layoutMini.visibility = View.VISIBLE } } @@ -722,9 +722,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } private fun showControlPanelTemporarily() { - controlPanel!!.visibility = View.VISIBLE - mVolHandler!!.removeCallbacks(mVolRunnable!!) - mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) + if (!isCircle){ + controlPanel.visibility = View.VISIBLE + mVolHandler!!.removeCallbacks(mVolRunnable!!) + mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) + } } /* Reset position of Floating Widget view on dragging */ diff --git a/android/app/src/main/res/drawable/ic_mini.xml b/android/app/src/main/res/drawable/ic_mini.xml index 300a9358..128a7430 100644 --- a/android/app/src/main/res/drawable/ic_mini.xml +++ b/android/app/src/main/res/drawable/ic_mini.xml @@ -1,5 +1,5 @@ - + diff --git a/android/app/src/main/res/layout/activity_video_call.xml b/android/app/src/main/res/layout/activity_video_call.xml index efc97746..a7470da3 100644 --- a/android/app/src/main/res/layout/activity_video_call.xml +++ b/android/app/src/main/res/layout/activity_video_call.xml @@ -37,9 +37,9 @@ android:id="@+id/cmTimer" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:padding="4dp" android:textColor="@color/white" android:textSize="16sp" - android:padding="4dp" android:textStyle="bold" tools:text="25:45" /> @@ -47,39 +47,38 @@ - - - - - + app:layout_constraintTop_toBottomOf="@+id/layout_name"> + + + + + android:src="@drawable/camera_back" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/btn_mic" + app:layout_constraintTop_toTopOf="parent" /> Date: Thu, 17 Jun 2021 10:14:00 +0300 Subject: [PATCH 115/124] fix drop video call issue --- .../kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt | 4 ++-- lib/config/config.dart | 4 ++-- .../model/patient_muse/PatientSearchRequestModel.dart | 3 ++- lib/core/service/VideoCallService.dart | 8 ++++---- lib/core/viewModel/scan_qr_view_model.dart | 2 +- .../profile/profile_screen/patient_profile_screen.dart | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 9a2deab6..66777d93 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -358,7 +358,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(session: Session, opentokError: OpentokError) { Log.d(TAG, "onError: Error (" + opentokError.message + ") in session " + session.sessionId) - videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in session ") + // videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in session ") // dialog?.dismiss() } @@ -398,7 +398,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(publisherKit: PublisherKit?, opentokError: OpentokError) { Log.d(VideoCallFragment.TAG, "onError: Error (" + opentokError.message + ") in publisher") - videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in publisher") + // videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in publisher") // dialog?.dismiss() } 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/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 2918a393..c2658c9f 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -12,7 +12,7 @@ class PatientSearchRequestModel { String mobileNo; String identificationNo; int nursingStationID; - int clinicID; + int clinicID=0; PatientSearchRequestModel( {this.doctorID = 0, @@ -63,6 +63,7 @@ class PatientSearchRequestModel { data['IdentificationNo'] = this.identificationNo; data['NursingStationID'] = this.nursingStationID; data['ClinicID'] = this.clinicID; + data['ProjectID'] = 0; return data; } } diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 0ae61a55..b3bc3c8d 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: startCallRes.openTokenID, - kSessionId: startCallRes.openSessionID, - kApiKey: '46209962',//'46209962', + kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//tartCallRes.openTokenID, + kSessionId: '1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg',//startCallRes.openSessionID, + kApiKey: '47247954',//'46209962', vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), @@ -79,7 +79,7 @@ class VideoCallService extends BaseService{ endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; - await _liveCarePatientServices.endCall(endCallReq); + // await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; } diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index ff934f79..86e975e3 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -13,7 +13,7 @@ class ScanQrViewModel extends BaseViewModel { await getDoctorProfile(); setState(ViewState.Busy); - await _scanQrService.getInPatient(requestModel, false); + await _scanQrService.getInPatient(requestModel, true); if (_scanQrService.hasError) { error = _scanQrService.error; diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 9aa95d16..d0117b40 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -343,14 +343,14 @@ class _PatientProfileScreenState extends State var asd = ""; } else { GifLoaderDialogUtils.showMyDialog(context); - // await model.startCall( isReCall : false, vCID: patient.vcId); + // await model.startCall( isReCall : false, vCID: patient.vcId); if(model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(model.error); } else { await model.getDoctorProfile(); - // patient.appointmentNo = model.startCallRes.appointmentNo; + // patient.appointmentNo = model.startCallRes.appointmentNo; patient.episodeNo = 0; GifLoaderDialogUtils.hideDialog(context); From 3c2abb66c62d2ba59218a7ef77bcd9622059a66b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Jun 2021 10:29:52 +0300 Subject: [PATCH 116/124] add video call permissions --- .../com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 52bafdfb..833855a0 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -329,7 +329,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session @AfterPermissionGranted(RC_VIDEO_APP_PERM) private fun requestPermissions() { - val perms = arrayOf(Manifest.permission.INTERNET, Manifest.permission.CAMERA) + val perms = arrayOf(Manifest.permission.INTERNET, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.MODIFY_AUDIO_SETTINGS, Manifest.permission.CALL_PHONE) if (EasyPermissions.hasPermissions(requireContext(), *perms)) { try { mSession = Session.Builder(context, apiKey, sessionId).build() @@ -496,19 +496,19 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private fun onMiniCircleClicked(){ if (isCircle) { - videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) - mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground)) dialog?.window?.setLayout( 400, 600 ) + videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) + mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground)) } else { - videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) - mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) dialog?.window?.setLayout( 200, 200 ) + videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) + mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) } isCircle = !isCircle From 654a86a9b64d7cf8c58d8232c9d17916e276fdc4 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 17 Jun 2021 12:17:56 +0300 Subject: [PATCH 117/124] Add App Permissions Utils --- lib/core/service/VideoCallService.dart | 1 + .../patient_profile_screen.dart | 6 +- lib/util/NotificationPermissionUtils.dart | 42 +++++++++ lib/widgets/dialog/AskPermissionDialog.dart | 90 +++++++++++++++++++ 4 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 lib/util/NotificationPermissionUtils.dart create mode 100644 lib/widgets/dialog/AskPermissionDialog.dart diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index b3bc3c8d..53739c9c 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -70,6 +70,7 @@ class VideoCallService extends BaseService{ }); }); + } Future endCall(int vCID, bool isPatient) async { hasError = false; diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index d0117b40..ea61359a 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; +import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -354,7 +355,10 @@ class _PatientProfileScreenState extends State patient.episodeNo = 0; GifLoaderDialogUtils.hideDialog(context); - locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); + AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ + locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); + }); + // await VideoChannel.openVideoCallScreen( // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID, diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart new file mode 100644 index 00000000..8950fae3 --- /dev/null +++ b/lib/util/NotificationPermissionUtils.dart @@ -0,0 +1,42 @@ +import 'package:doctor_app_flutter/widgets/dialog/AskPermissionDialog.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; + + +class AppPermissionsUtils { + + static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { + + var cameraPermission = Permission.camera; + var microphonePermission = Permission.microphone; + PermissionStatus permissionCameraStatus = await cameraPermission.status; + PermissionStatus permissionMicrophoneStatus = await microphonePermission.status; + + if (permissionCameraStatus.isPermanentlyDenied || permissionMicrophoneStatus.isPermanentlyDenied) { + await _showPermissionDialog(context, type,onTapGrant); + } else if (!permissionCameraStatus.isGranted || !permissionMicrophoneStatus.isGranted) { + permissionCameraStatus = await cameraPermission.request(); + permissionMicrophoneStatus = await microphonePermission.request(); + if (permissionCameraStatus.isDenied || permissionMicrophoneStatus.isDenied) + await _showPermissionDialog(context, type,onTapGrant); + else + onTapGrant(); + } else if (permissionCameraStatus.isDenied || permissionMicrophoneStatus.isDenied) + await _showPermissionDialog(context, type,onTapGrant); + else + onTapGrant(); + } + + static _showPermissionDialog(BuildContext context, String type,Function onTapGrant) async { + Navigator.push( + context, SlideUpPageRoute(widget: AskPermissionDialog(type: type,onTapGrant: onTapGrant,))); + } + + static Future isVideoCallPermissionGranted() async { + PermissionStatus permissionCameraStatus = await Permission.camera.status; + PermissionStatus permissionMicrophoneStatus = await Permission.microphone.status; + return permissionCameraStatus.isGranted && permissionMicrophoneStatus.isGranted; + } +} diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart new file mode 100644 index 00000000..58718373 --- /dev/null +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -0,0 +1,90 @@ +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:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; + +class AskPermissionDialog extends StatefulWidget { + final String type; + final Function onTapGrant; + + AskPermissionDialog({this.type, this.onTapGrant}); + + @override + _AskPermissionDialogState createState() => _AskPermissionDialogState(); +} + +class _AskPermissionDialogState extends State { + getText() { + return "Turn on your Camera, Microphone to start video call"; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + automaticallyImplyLeading: false, + elevation: 0.5, + actions: [ + Padding( + padding: EdgeInsets.only(right: 18.0), + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: Feedback.wrapForTap(() { + Navigator.pop(context); + }, context), + child: + Icon(EvaIcons.close, color: Theme.of(context).primaryColor), + ), + ) + ], + ), + body: Container( + margin: EdgeInsets.symmetric(horizontal: 48), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + "🙋‍♀", + style: "headline1", + color: Colors.black, + ), + AppText( + "Don't miss out!", + style: "headline4", + color: Colors.black, + ), + SizedBox( + height: 8, + ), + AppText( + getText(), + color: Colors.grey, + style: "bodyText2", + textAlign: TextAlign.center, + ), + SizedBox( + height: MediaQuery.of(context).size.height / 6, + ), + AppButton( + fontColor: Theme.of(context).backgroundColor, + color: Colors.red[700], + title: "Turn On Camera, Microphone", + onPressed: () async { + openAppSettings().then((value) { + Navigator.pop(context); + widget.onTapGrant(); + }); + }, + ), + ], + ), + ), + ), + ); + } +} From c67f3d10ad1b43b2d9e7c7e289e5384f297da1c8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Jun 2021 13:54:50 +0300 Subject: [PATCH 118/124] fix circle video stream --- .../hmgDr/ui/fragment/VideoCallFragment.kt | 96 +++-- .../hmg/hmgDr/util/DynamicVideoRenderer.kt | 379 ++++++++++++++++++ .../util/ThumbnailCircleVideoRenderer.kt | 357 +++++++++++++++++ .../main/res/layout/activity_video_call.xml | 13 +- 4 files changed, 817 insertions(+), 28 deletions(-) create mode 100644 android/app/src/main/kotlin/com/hmg/hmgDr/util/DynamicVideoRenderer.kt create mode 100644 android/app/src/main/kotlin/com/hmg/hmgDr/util/ThumbnailCircleVideoRenderer.kt diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 833855a0..5b98b27d 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -27,6 +27,8 @@ import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView import com.hmg.hmgDr.ui.VideoCallPresenterImpl import com.hmg.hmgDr.ui.VideoCallResponseListener +import com.hmg.hmgDr.util.DynamicVideoRenderer +import com.hmg.hmgDr.util.ThumbnailCircleVideoRenderer import com.opentok.android.* import com.opentok.android.PublisherKit.PublisherListener import pub.devrel.easypermissions.AfterPermissionGranted @@ -60,6 +62,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private var mVolRunnable: Runnable? = null private var mConnectedRunnable: Runnable? = null + private lateinit var thumbnail_container: FrameLayout private lateinit var mPublisherViewContainer: FrameLayout private lateinit var mPublisherViewIcon: View private lateinit var mSubscriberViewContainer: FrameLayout @@ -220,6 +223,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session layoutName = view.findViewById(R.id.layout_name) layoutMini = view.findViewById(R.id.layout_mini) icMini = view.findViewById(R.id.ic_mini) + thumbnail_container = view.findViewById(R.id.thumbnail_container) mPublisherViewContainer = view.findViewById(R.id.local_video_view_container) mPublisherViewIcon = view.findViewById(R.id.local_video_view_icon) mSubscriberViewIcon = view.findViewById(R.id.remote_video_view_icon) @@ -345,12 +349,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onConnected(session: Session?) { Log.i(TAG, "Session Connected") - mPublisher = Publisher.Builder(requireContext()).build() + mPublisher = Publisher.Builder(requireContext()) +// .name("publisher") +// .renderer(ThumbnailCircleVideoRenderer(requireContext())) + .build() mPublisher!!.setPublisherListener(this) - mPublisherViewContainer.addView(mPublisher!!.view) - if (mPublisher!!.getView() is GLSurfaceView) { - (mPublisher!!.getView() as GLSurfaceView).setZOrderOnTop(true) + if (mPublisher!!.view is GLSurfaceView) { + (mPublisher!!.view as GLSurfaceView).setZOrderOnTop(true) } + + mPublisherViewContainer.addView(mPublisher!!.view) mSession!!.publish(mPublisher) if (!resume) { @@ -368,7 +376,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(session: Session, opentokError: OpentokError) { Log.d(TAG, "onError: Error (" + opentokError.message + ") in session " + session.sessionId) - // videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in session ") + // videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in session ") // dialog?.dismiss() } @@ -391,7 +399,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session return } if (mSubscriber!!.stream == stream) { - mSubscriberViewContainer!!.removeView(mSubscriber!!.view) + mSubscriberViewContainer.removeView(mSubscriber!!.view) mSubscriber!!.destroy() mSubscriber = null } @@ -408,13 +416,49 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onError(publisherKit: PublisherKit?, opentokError: OpentokError) { Log.d(VideoCallFragment.TAG, "onError: Error (" + opentokError.message + ") in publisher") - // videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in publisher") + // videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in publisher") // dialog?.dismiss() } override fun onVideoDataReceived(subscriberKit: SubscriberKit?) { mSubscriber!!.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL) - mSubscriberViewContainer!!.addView(mSubscriber!!.view) + (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(false) + mSubscriberViewContainer.addView(mSubscriber!!.view) +// switchToThumbnailCircle() + } + + fun switchToThumbnailCircle() { + thumbnail_container.postDelayed({ + val view = mSubscriber!!.view + if (view.parent != null) { + (view.parent as ViewGroup).removeView(view) + } + if (view is GLSurfaceView) { + view.setZOrderOnTop(true) + if (mSubscriber!!.renderer is DynamicVideoRenderer) { + (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(true) + thumbnail_container.addView(view) + } + } + switchToFullScreenView() + }, 4000) + } + + fun switchToFullScreenView() { + mSubscriberViewContainer.postDelayed({ + val view = mSubscriber!!.view + if (view.parent != null) { + (view.parent as ViewGroup).removeView(view) + } + if (view is GLSurfaceView) { + view.setZOrderOnTop(false) + if (mSubscriber!!.renderer is DynamicVideoRenderer) { + (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(false) + mSubscriberViewContainer.addView(view) + } + } + switchToThumbnailCircle() + }, 4000) } override fun onVideoDisabled(subscriberKit: SubscriberKit?, s: String?) {} @@ -426,7 +470,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onVideoDisableWarningLifted(subscriberKit: SubscriberKit?) {} private fun subscribeToStream(stream: Stream) { - mSubscriber = Subscriber.Builder(requireContext(), stream).build() + mSubscriber = Subscriber.Builder(requireContext(), stream) + .renderer(DynamicVideoRenderer(requireContext())) + .build() mSubscriber!!.setVideoListener(this) mSession!!.subscribe(mSubscriber) } @@ -488,31 +534,29 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session disconnectSession() } - private fun miniCircleDoubleTap(){ - if (isCircle){ + private fun miniCircleDoubleTap() { + if (isCircle) { onMiniCircleClicked() } } - private fun onMiniCircleClicked(){ + private fun onMiniCircleClicked() { if (isCircle) { dialog?.window?.setLayout( 400, 600 ) - videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) - mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground)) + (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(false) } else { dialog?.window?.setLayout( - 200, - 200 + 300, + 300 ) - videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) - mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) + (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(true) } isCircle = !isCircle - if(isCircle){ + if (isCircle) { controlPanel.visibility = View.GONE layoutMini.visibility = View.GONE } else { @@ -548,16 +592,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session val btnMinimizeLayoutParam: ConstraintLayout.LayoutParams = btnMinimize.layoutParams as ConstraintLayout.LayoutParams val mCallBtnLayoutParam: ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams - val localPreviewMargin : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() - val localPreviewWidth : Int = context!!.resources.getDimension(R.dimen.local_preview_width).toInt() - val localPreviewHeight : Int = context!!.resources.getDimension(R.dimen.local_preview_height).toInt() + val localPreviewMargin: Int = context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() + val localPreviewWidth: Int = context!!.resources.getDimension(R.dimen.local_preview_width).toInt() + val localPreviewHeight: Int = context!!.resources.getDimension(R.dimen.local_preview_height).toInt() // val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt() // val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt() // val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt() // val localPreviewHeightSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_height_small).toInt() // val localPreviewIconSmall: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size_small).toInt() // val localPreviewLayoutIconParam : FrameLayout.LayoutParams - val localPreviewLayoutParam : RelativeLayout.LayoutParams = mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams + val localPreviewLayoutParam: RelativeLayout.LayoutParams = mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams val remotePreviewIconSize: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt() val remotePreviewIconSizeSmall: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() @@ -611,7 +655,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session remotePreviewLayoutParam.width = remotePreviewIconSizeSmall remotePreviewLayoutParam.height = remotePreviewIconSizeSmall - if(isCircle){ + if (isCircle) { controlPanel.visibility = View.GONE layoutMini.visibility = View.GONE } else { @@ -651,7 +695,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session isSpeckerClicked = !isSpeckerClicked mSubscriber!!.subscribeToAudio = !isSpeckerClicked val res = if (isSpeckerClicked) R.drawable.audio_disabled else R.drawable.audio_enabled - mspeckerBtn!!.setImageResource(res) + mspeckerBtn.setImageResource(res) } } @@ -722,7 +766,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } private fun showControlPanelTemporarily() { - if (!isCircle){ + if (!isCircle) { controlPanel.visibility = View.VISIBLE mVolHandler!!.removeCallbacks(mVolRunnable!!) mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong()) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/util/DynamicVideoRenderer.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/util/DynamicVideoRenderer.kt new file mode 100644 index 00000000..1a307eb5 --- /dev/null +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/util/DynamicVideoRenderer.kt @@ -0,0 +1,379 @@ +package com.hmg.hmgDr.util + +import android.content.Context +import android.content.res.Resources +import android.graphics.PixelFormat +import android.opengl.GLES20 +import android.opengl.GLSurfaceView +import android.opengl.Matrix +import android.view.View +import com.opentok.android.BaseVideoRenderer +import java.nio.ByteBuffer +import java.nio.ByteOrder +import java.nio.FloatBuffer +import java.nio.ShortBuffer +import java.util.concurrent.locks.ReentrantLock +import javax.microedition.khronos.egl.EGLConfig +import javax.microedition.khronos.opengles.GL10 + +/* +* https://nhancv.medium.com/android-how-to-make-a-circular-view-as-a-thumbnail-of-opentok-27992aee15c9 +* to solve make circle video stream +* */ + +class DynamicVideoRenderer(private val mContext: Context) : BaseVideoRenderer() { + private val mView: GLSurfaceView = GLSurfaceView(mContext) + private val mRenderer: MyRenderer + + interface DynamicVideoRendererMetadataListener { + fun onMetadataReady(metadata: ByteArray?) + } + + fun setDynamicVideoRendererMetadataListener(metadataListener: DynamicVideoRendererMetadataListener?) { + mRenderer.metadataListener = metadataListener + } + + fun enableThumbnailCircle(enable: Boolean) { + mRenderer.requestEnableThumbnailCircle = enable + } + + internal class MyRenderer : GLSurfaceView.Renderer { + var mTextureIds = IntArray(3) + var mScaleMatrix = FloatArray(16) + private val mVertexBuffer: FloatBuffer + private val mTextureBuffer: FloatBuffer + private val mDrawListBuffer: ShortBuffer + var requestEnableThumbnailCircle = false + var mVideoFitEnabled = true + var mVideoDisabled = false + private val mVertexIndex = shortArrayOf(0, 1, 2, 0, 2, 3) // order to draw + + // vertices + private val vertexShaderCode = """uniform mat4 uMVPMatrix;attribute vec4 aPosition; +attribute vec2 aTextureCoord; +varying vec2 vTextureCoord; +void main() { + gl_Position = uMVPMatrix * aPosition; + vTextureCoord = aTextureCoord; +} +""" + private val fragmentShaderCode = """precision mediump float; +uniform sampler2D Ytex; +uniform sampler2D Utex,Vtex; +uniform int enableCircle; +uniform vec2 radiusDp; +varying vec2 vTextureCoord; +void main(void) { + float nx,ny,r,g,b,y,u,v; + mediump vec4 txl,ux,vx; nx=vTextureCoord[0]; + ny=vTextureCoord[1]; + y=texture2D(Ytex,vec2(nx,ny)).r; + u=texture2D(Utex,vec2(nx,ny)).r; + v=texture2D(Vtex,vec2(nx,ny)).r; + y=1.1643*(y-0.0625); + u=u-0.5; + v=v-0.5; + r=y+1.5958*v; + g=y-0.39173*u-0.81290*v; + b=y+2.017*u; + if (enableCircle > 0) { + float radius = 0.5; + vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0); + vec4 color1 = vec4(r, g, b, 1.0); + vec2 st = (gl_FragCoord.xy/radiusDp.xy); float dist = radius - distance(st,vec2(0.5)); + float t = 1.0; + if (dist < 0.0) t = 0.0; + gl_FragColor = mix(color0, color1, t); + } + else { + gl_FragColor = vec4(r, g, b, 1.0); + } +} +""" + var mFrameLock = ReentrantLock() + var mCurrentFrame: Frame? = null + private var mProgram = 0 + private var mTextureWidth = 0 + private var mTextureHeight = 0 + private var mViewportWidth = 0 + private var mViewportHeight = 0 + override fun onSurfaceCreated(gl: GL10, config: EGLConfig) { + gl.glClearColor(0f, 0f, 0f, 1f) + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT) + val vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, + vertexShaderCode) + val fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, + fragmentShaderCode) + mProgram = GLES20.glCreateProgram() // create empty OpenGL ES + // Program + GLES20.glAttachShader(mProgram, vertexShader) // add the vertex + // shader to program + GLES20.glAttachShader(mProgram, fragmentShader) // add the fragment + // shader to + // program + GLES20.glLinkProgram(mProgram) + val positionHandle = GLES20.glGetAttribLocation(mProgram, + "aPosition") + val textureHandle = GLES20.glGetAttribLocation(mProgram, + "aTextureCoord") + GLES20.glVertexAttribPointer(positionHandle, COORDS_PER_VERTEX, + GLES20.GL_FLOAT, false, COORDS_PER_VERTEX * 4, + mVertexBuffer) + GLES20.glEnableVertexAttribArray(positionHandle) + GLES20.glVertexAttribPointer(textureHandle, + TEXTURECOORDS_PER_VERTEX, GLES20.GL_FLOAT, false, + TEXTURECOORDS_PER_VERTEX * 4, mTextureBuffer) + GLES20.glEnableVertexAttribArray(textureHandle) + GLES20.glUseProgram(mProgram) + var i = GLES20.glGetUniformLocation(mProgram, "Ytex") + GLES20.glUniform1i(i, 0) /* Bind Ytex to texture unit 0 */ + i = GLES20.glGetUniformLocation(mProgram, "Utex") + GLES20.glUniform1i(i, 1) /* Bind Utex to texture unit 1 */ + i = GLES20.glGetUniformLocation(mProgram, "Vtex") + GLES20.glUniform1i(i, 2) /* Bind Vtex to texture unit 2 */ + val radiusDpLocation = GLES20.glGetUniformLocation(mProgram, "radiusDp") + val radiusDp = (Resources.getSystem().displayMetrics.density * THUMBNAIL_SIZE).toInt() + GLES20.glUniform2f(radiusDpLocation, radiusDp.toFloat(), radiusDp.toFloat()) + mTextureWidth = 0 + mTextureHeight = 0 + } + + fun enableThumbnailCircle(enable: Boolean) { + GLES20.glUseProgram(mProgram) + val enableCircleLocation = GLES20.glGetUniformLocation(mProgram, "enableCircle") + GLES20.glUniform1i(enableCircleLocation, if (enable) 1 else 0) + } + + fun setupTextures(frame: Frame) { + if (mTextureIds[0] != 0) { + GLES20.glDeleteTextures(3, mTextureIds, 0) + } + GLES20.glGenTextures(3, mTextureIds, 0) + val w = frame.width + val h = frame.height + val hw = w + 1 shr 1 + val hh = h + 1 shr 1 + initializeTexture(GLES20.GL_TEXTURE0, mTextureIds[0], w, h) + initializeTexture(GLES20.GL_TEXTURE1, mTextureIds[1], hw, hh) + initializeTexture(GLES20.GL_TEXTURE2, mTextureIds[2], hw, hh) + mTextureWidth = frame.width + mTextureHeight = frame.height + } + + fun updateTextures(frame: Frame) { + val width = frame.width + val height = frame.height + val half_width = width + 1 shr 1 + val half_height = height + 1 shr 1 + val y_size = width * height + val uv_size = half_width * half_height + val bb = frame.buffer + // If we are reusing this frame, make sure we reset position and + // limit + bb.clear() + if (bb.remaining() == y_size + uv_size * 2) { + bb.position(0) + GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1) + GLES20.glPixelStorei(GLES20.GL_PACK_ALIGNMENT, 1) + GLES20.glActiveTexture(GLES20.GL_TEXTURE0) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIds[0]) + GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, width, + height, GLES20.GL_LUMINANCE, GLES20.GL_UNSIGNED_BYTE, + bb) + bb.position(y_size) + GLES20.glActiveTexture(GLES20.GL_TEXTURE1) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIds[1]) + GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, + half_width, half_height, GLES20.GL_LUMINANCE, + GLES20.GL_UNSIGNED_BYTE, bb) + bb.position(y_size + uv_size) + GLES20.glActiveTexture(GLES20.GL_TEXTURE2) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIds[2]) + GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, + half_width, half_height, GLES20.GL_LUMINANCE, + GLES20.GL_UNSIGNED_BYTE, bb) + } else { + mTextureWidth = 0 + mTextureHeight = 0 + } + } + + override fun onSurfaceChanged(gl: GL10, width: Int, height: Int) { + GLES20.glViewport(0, 0, width, height) + mViewportWidth = width + mViewportHeight = height + } + + var metadataListener: DynamicVideoRendererMetadataListener? = null + override fun onDrawFrame(gl: GL10) { + gl.glClearColor(0f, 0f, 0f, 0f) + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT) + mFrameLock.lock() + if (mCurrentFrame != null && !mVideoDisabled) { + GLES20.glUseProgram(mProgram) + if (mTextureWidth != mCurrentFrame!!.width + || mTextureHeight != mCurrentFrame!!.height) { + setupTextures(mCurrentFrame!!) + } + updateTextures(mCurrentFrame!!) + Matrix.setIdentityM(mScaleMatrix, 0) + var scaleX = 1.0f + var scaleY = 1.0f + val ratio = (mCurrentFrame!!.width.toFloat() + / mCurrentFrame!!.height) + val vratio = mViewportWidth.toFloat() / mViewportHeight + if (mVideoFitEnabled) { + if (ratio > vratio) { + scaleY = vratio / ratio + } else { + scaleX = ratio / vratio + } + } else { + if (ratio < vratio) { + scaleY = vratio / ratio + } else { + scaleX = ratio / vratio + } + } + Matrix.scaleM(mScaleMatrix, 0, + scaleX * if (mCurrentFrame!!.isMirroredX) -1.0f else 1.0f, + scaleY, 1f) + metadataListener?.onMetadataReady(mCurrentFrame!!.metadata) + val mMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, + "uMVPMatrix") + GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, + mScaleMatrix, 0) + enableThumbnailCircle(requestEnableThumbnailCircle) + GLES20.glDrawElements(GLES20.GL_TRIANGLES, mVertexIndex.size, + GLES20.GL_UNSIGNED_SHORT, mDrawListBuffer) + } else { + //black frame when video is disabled + gl.glClearColor(0f, 0f, 0f, 1f) + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT) + } + mFrameLock.unlock() + } + + fun displayFrame(frame: Frame?) { + mFrameLock.lock() + if (mCurrentFrame != null) { + mCurrentFrame!!.recycle() + } + mCurrentFrame = frame + mFrameLock.unlock() + } + + fun disableVideo(b: Boolean) { + mFrameLock.lock() + mVideoDisabled = b + if (mVideoDisabled) { + if (mCurrentFrame != null) { + mCurrentFrame!!.recycle() + } + mCurrentFrame = null + } + mFrameLock.unlock() + } + + fun enableVideoFit(enableVideoFit: Boolean) { + mVideoFitEnabled = enableVideoFit + } + + companion object { + // number of coordinates per vertex in this array + const val COORDS_PER_VERTEX = 3 + const val TEXTURECOORDS_PER_VERTEX = 2 + var mXYZCoords = floatArrayOf( + -1.0f, 1.0f, 0.0f, // top left + -1.0f, -1.0f, 0.0f, // bottom left + 1.0f, -1.0f, 0.0f, // bottom right + 1.0f, 1.0f, 0.0f // top right + ) + var mUVCoords = floatArrayOf(0f, 0f, 0f, 1f, 1f, 1f, 1f, 0f) + fun initializeTexture(name: Int, id: Int, width: Int, height: Int) { + GLES20.glActiveTexture(name) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, id) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST.toFloat()) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR.toFloat()) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE.toFloat()) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE.toFloat()) + GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_LUMINANCE, + width, height, 0, GLES20.GL_LUMINANCE, + GLES20.GL_UNSIGNED_BYTE, null) + } + + fun loadShader(type: Int, shaderCode: String?): Int { + val shader = GLES20.glCreateShader(type) + GLES20.glShaderSource(shader, shaderCode) + GLES20.glCompileShader(shader) + return shader + } + } + + init { + val bb = ByteBuffer.allocateDirect(mXYZCoords.size * 4) + bb.order(ByteOrder.nativeOrder()) + mVertexBuffer = bb.asFloatBuffer() + mVertexBuffer.put(mXYZCoords) + mVertexBuffer.position(0) + val tb = ByteBuffer.allocateDirect(mUVCoords.size * 4) + tb.order(ByteOrder.nativeOrder()) + mTextureBuffer = tb.asFloatBuffer() + mTextureBuffer.put(mUVCoords) + mTextureBuffer.position(0) + val dlb = ByteBuffer.allocateDirect(mVertexIndex.size * 2) + dlb.order(ByteOrder.nativeOrder()) + mDrawListBuffer = dlb.asShortBuffer() + mDrawListBuffer.put(mVertexIndex) + mDrawListBuffer.position(0) + } + } + + override fun onFrame(frame: Frame) { + mRenderer.displayFrame(frame) + mView.requestRender() + } + + override fun setStyle(key: String, value: String) { + if (STYLE_VIDEO_SCALE == key) { + if (STYLE_VIDEO_FIT == value) { + mRenderer.enableVideoFit(true) + } else if (STYLE_VIDEO_FILL == value) { + mRenderer.enableVideoFit(false) + } + } + } + + override fun onVideoPropertiesChanged(videoEnabled: Boolean) { + mRenderer.disableVideo(!videoEnabled) + } + + override fun getView(): View { + return mView + } + + override fun onPause() { + mView.onPause() + } + + override fun onResume() { + mView.onResume() + } + + companion object { + private const val THUMBNAIL_SIZE = 90 //in dp + } + + init { + mView.setEGLContextClientVersion(2) + mView.setEGLConfigChooser(8, 8, 8, 8, 16, 0) + mView.holder.setFormat(PixelFormat.TRANSLUCENT) + mRenderer = MyRenderer() + mView.setRenderer(mRenderer) + mView.renderMode = GLSurfaceView.RENDERMODE_WHEN_DIRTY + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/util/ThumbnailCircleVideoRenderer.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/util/ThumbnailCircleVideoRenderer.kt new file mode 100644 index 00000000..b9b5a245 --- /dev/null +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/util/ThumbnailCircleVideoRenderer.kt @@ -0,0 +1,357 @@ +package com.hmg.hmgDr.util + +import android.content.Context +import android.content.res.Resources +import android.graphics.PixelFormat +import android.opengl.GLES20 +import android.opengl.GLSurfaceView +import android.opengl.Matrix +import android.view.View +import com.opentok.android.BaseVideoRenderer +import java.nio.ByteBuffer +import java.nio.ByteOrder +import java.nio.FloatBuffer +import java.nio.ShortBuffer +import java.util.concurrent.locks.ReentrantLock +import javax.microedition.khronos.egl.EGLConfig +import javax.microedition.khronos.opengles.GL10 + + +class ThumbnailCircleVideoRenderer(private val mContext: Context) : BaseVideoRenderer() { + private val mView: GLSurfaceView = GLSurfaceView(mContext) + private val mRenderer: MyRenderer + + interface ThumbnailCircleVideoRendererMetadataListener { + fun onMetadataReady(metadata: ByteArray?) + } + + fun setThumbnailCircleVideoRendererMetadataListener(metadataListener: ThumbnailCircleVideoRendererMetadataListener?) { + mRenderer.metadataListener = metadataListener + } + + internal class MyRenderer : GLSurfaceView.Renderer { + var mTextureIds = IntArray(3) + var mScaleMatrix = FloatArray(16) + private val mVertexBuffer: FloatBuffer + private val mTextureBuffer: FloatBuffer + private val mDrawListBuffer: ShortBuffer + var mVideoFitEnabled = true + var mVideoDisabled = false + private val mVertexIndex = shortArrayOf(0, 1, 2, 0, 2, 3) // order to draw + + // vertices + private val vertexShaderCode = """uniform mat4 uMVPMatrix;attribute vec4 aPosition; +attribute vec2 aTextureCoord; +varying vec2 vTextureCoord; +void main() { + gl_Position = uMVPMatrix * aPosition; + vTextureCoord = aTextureCoord; +} +""" + private val fragmentShaderCode = """precision mediump float; +uniform sampler2D Ytex; +uniform sampler2D Utex,Vtex; +uniform vec2 radiusDp; +varying vec2 vTextureCoord; +void main(void) { + float nx,ny,r,g,b,y,u,v; + mediump vec4 txl,ux,vx; nx=vTextureCoord[0]; + ny=vTextureCoord[1]; + y=texture2D(Ytex,vec2(nx,ny)).r; + u=texture2D(Utex,vec2(nx,ny)).r; + v=texture2D(Vtex,vec2(nx,ny)).r; + y=1.1643*(y-0.0625); + u=u-0.5; + v=v-0.5; + r=y+1.5958*v; + g=y-0.39173*u-0.81290*v; + b=y+2.017*u; + float radius = 0.5; + vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0); + vec4 color1 = vec4(r, g, b, 1.0); + vec2 st = (gl_FragCoord.xy/radiusDp.xy); float dist = radius - distance(st,vec2(0.5)); + float t = 1.0; + if (dist < 0.0) t = 0.0; + gl_FragColor = mix(color0, color1, t); +} +""" + var mFrameLock = ReentrantLock() + var mCurrentFrame: Frame? = null + private var mProgram = 0 + private var mTextureWidth = 0 + private var mTextureHeight = 0 + private var mViewportWidth = 0 + private var mViewportHeight = 0 + override fun onSurfaceCreated(gl: GL10, config: EGLConfig) { + gl.glClearColor(0f, 0f, 0f, 1f) + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT) + val vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, + vertexShaderCode) + val fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, + fragmentShaderCode) + mProgram = GLES20.glCreateProgram() // create empty OpenGL ES + // Program + GLES20.glAttachShader(mProgram, vertexShader) // add the vertex + // shader to program + GLES20.glAttachShader(mProgram, fragmentShader) // add the fragment + // shader to + // program + GLES20.glLinkProgram(mProgram) + val positionHandle = GLES20.glGetAttribLocation(mProgram, + "aPosition") + val textureHandle = GLES20.glGetAttribLocation(mProgram, + "aTextureCoord") + GLES20.glVertexAttribPointer(positionHandle, COORDS_PER_VERTEX, + GLES20.GL_FLOAT, false, COORDS_PER_VERTEX * 4, + mVertexBuffer) + GLES20.glEnableVertexAttribArray(positionHandle) + GLES20.glVertexAttribPointer(textureHandle, + TEXTURECOORDS_PER_VERTEX, GLES20.GL_FLOAT, false, + TEXTURECOORDS_PER_VERTEX * 4, mTextureBuffer) + GLES20.glEnableVertexAttribArray(textureHandle) + GLES20.glUseProgram(mProgram) + var i = GLES20.glGetUniformLocation(mProgram, "Ytex") + GLES20.glUniform1i(i, 0) /* Bind Ytex to texture unit 0 */ + i = GLES20.glGetUniformLocation(mProgram, "Utex") + GLES20.glUniform1i(i, 1) /* Bind Utex to texture unit 1 */ + i = GLES20.glGetUniformLocation(mProgram, "Vtex") + GLES20.glUniform1i(i, 2) /* Bind Vtex to texture unit 2 */ + val radiusDpLocation = GLES20.glGetUniformLocation(mProgram, "radiusDp") + val radiusDp = (Resources.getSystem().displayMetrics.density * THUMBNAIL_SIZE).toInt() + GLES20.glUniform2f(radiusDpLocation, radiusDp.toFloat(), radiusDp.toFloat()) + mTextureWidth = 0 + mTextureHeight = 0 + } + + fun setupTextures(frame: Frame) { + if (mTextureIds[0] != 0) { + GLES20.glDeleteTextures(3, mTextureIds, 0) + } + GLES20.glGenTextures(3, mTextureIds, 0) + val w = frame.width + val h = frame.height + val hw = w + 1 shr 1 + val hh = h + 1 shr 1 + initializeTexture(GLES20.GL_TEXTURE0, mTextureIds[0], w, h) + initializeTexture(GLES20.GL_TEXTURE1, mTextureIds[1], hw, hh) + initializeTexture(GLES20.GL_TEXTURE2, mTextureIds[2], hw, hh) + mTextureWidth = frame.width + mTextureHeight = frame.height + } + + fun updateTextures(frame: Frame) { + val width = frame.width + val height = frame.height + val half_width = width + 1 shr 1 + val half_height = height + 1 shr 1 + val y_size = width * height + val uv_size = half_width * half_height + val bb = frame.buffer + // If we are reusing this frame, make sure we reset position and + // limit + bb.clear() + if (bb.remaining() == y_size + uv_size * 2) { + bb.position(0) + GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1) + GLES20.glPixelStorei(GLES20.GL_PACK_ALIGNMENT, 1) + GLES20.glActiveTexture(GLES20.GL_TEXTURE0) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIds[0]) + GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, width, + height, GLES20.GL_LUMINANCE, GLES20.GL_UNSIGNED_BYTE, + bb) + bb.position(y_size) + GLES20.glActiveTexture(GLES20.GL_TEXTURE1) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIds[1]) + GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, + half_width, half_height, GLES20.GL_LUMINANCE, + GLES20.GL_UNSIGNED_BYTE, bb) + bb.position(y_size + uv_size) + GLES20.glActiveTexture(GLES20.GL_TEXTURE2) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIds[2]) + GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, + half_width, half_height, GLES20.GL_LUMINANCE, + GLES20.GL_UNSIGNED_BYTE, bb) + } else { + mTextureWidth = 0 + mTextureHeight = 0 + } + } + + override fun onSurfaceChanged(gl: GL10, width: Int, height: Int) { + GLES20.glViewport(0, 0, width, height) + mViewportWidth = width + mViewportHeight = height + } + + var metadataListener: ThumbnailCircleVideoRendererMetadataListener? = null + override fun onDrawFrame(gl: GL10) { + gl.glClearColor(0f, 0f, 0f, 0f) + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT) + mFrameLock.lock() + if (mCurrentFrame != null && !mVideoDisabled) { + GLES20.glUseProgram(mProgram) + if (mTextureWidth != mCurrentFrame!!.width + || mTextureHeight != mCurrentFrame!!.height) { + setupTextures(mCurrentFrame!!) + } + updateTextures(mCurrentFrame!!) + Matrix.setIdentityM(mScaleMatrix, 0) + var scaleX = 1.0f + var scaleY = 1.0f + val ratio = (mCurrentFrame!!.width.toFloat() + / mCurrentFrame!!.height) + val vratio = mViewportWidth.toFloat() / mViewportHeight + if (mVideoFitEnabled) { + if (ratio > vratio) { + scaleY = vratio / ratio + } else { + scaleX = ratio / vratio + } + } else { + if (ratio < vratio) { + scaleY = vratio / ratio + } else { + scaleX = ratio / vratio + } + } + Matrix.scaleM(mScaleMatrix, 0, + scaleX * if (mCurrentFrame!!.isMirroredX) -1.0f else 1.0f, + scaleY, 1f) + metadataListener?.onMetadataReady(mCurrentFrame!!.metadata) + val mMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, + "uMVPMatrix") + GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, + mScaleMatrix, 0) + GLES20.glDrawElements(GLES20.GL_TRIANGLES, mVertexIndex.size, + GLES20.GL_UNSIGNED_SHORT, mDrawListBuffer) + } else { + //black frame when video is disabled + gl.glClearColor(0f, 0f, 0f, 1f) + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT) + } + mFrameLock.unlock() + } + + fun displayFrame(frame: Frame?) { + mFrameLock.lock() + if (mCurrentFrame != null) { + mCurrentFrame!!.recycle() + } + mCurrentFrame = frame + mFrameLock.unlock() + } + + fun disableVideo(b: Boolean) { + mFrameLock.lock() + mVideoDisabled = b + if (mVideoDisabled) { + if (mCurrentFrame != null) { + mCurrentFrame!!.recycle() + } + mCurrentFrame = null + } + mFrameLock.unlock() + } + + fun enableVideoFit(enableVideoFit: Boolean) { + mVideoFitEnabled = enableVideoFit + } + + companion object { + // number of coordinates per vertex in this array + const val COORDS_PER_VERTEX = 3 + const val TEXTURECOORDS_PER_VERTEX = 2 + var mXYZCoords = floatArrayOf( + -1.0f, 1.0f, 0.0f, // top left + -1.0f, -1.0f, 0.0f, // bottom left + 1.0f, -1.0f, 0.0f, // bottom right + 1.0f, 1.0f, 0.0f // top right + ) + var mUVCoords = floatArrayOf(0f, 0f, 0f, 1f, 1f, 1f, 1f, 0f) + fun initializeTexture(name: Int, id: Int, width: Int, height: Int) { + GLES20.glActiveTexture(name) + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, id) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST.toFloat()) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR.toFloat()) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE.toFloat()) + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, + GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE.toFloat()) + GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_LUMINANCE, + width, height, 0, GLES20.GL_LUMINANCE, + GLES20.GL_UNSIGNED_BYTE, null) + } + + fun loadShader(type: Int, shaderCode: String?): Int { + val shader = GLES20.glCreateShader(type) + GLES20.glShaderSource(shader, shaderCode) + GLES20.glCompileShader(shader) + return shader + } + } + + init { + val bb = ByteBuffer.allocateDirect(mXYZCoords.size * 4) + bb.order(ByteOrder.nativeOrder()) + mVertexBuffer = bb.asFloatBuffer() + mVertexBuffer.put(mXYZCoords) + mVertexBuffer.position(0) + val tb = ByteBuffer.allocateDirect(mUVCoords.size * 4) + tb.order(ByteOrder.nativeOrder()) + mTextureBuffer = tb.asFloatBuffer() + mTextureBuffer.put(mUVCoords) + mTextureBuffer.position(0) + val dlb = ByteBuffer.allocateDirect(mVertexIndex.size * 2) + dlb.order(ByteOrder.nativeOrder()) + mDrawListBuffer = dlb.asShortBuffer() + mDrawListBuffer.put(mVertexIndex) + mDrawListBuffer.position(0) + } + } + + override fun onFrame(frame: Frame) { + mRenderer.displayFrame(frame) + mView.requestRender() + } + + override fun setStyle(key: String, value: String) { + if (STYLE_VIDEO_SCALE == key) { + if (STYLE_VIDEO_FIT == value) { + mRenderer.enableVideoFit(true) + } else if (STYLE_VIDEO_FILL == value) { + mRenderer.enableVideoFit(false) + } + } + } + + override fun onVideoPropertiesChanged(videoEnabled: Boolean) { + mRenderer.disableVideo(!videoEnabled) + } + + override fun getView(): View { + return mView + } + + override fun onPause() { + mView.onPause() + } + + override fun onResume() { + mView.onResume() + } + + companion object { + private const val THUMBNAIL_SIZE = 90 //in dp + } + + init { + mView.setEGLContextClientVersion(2) + mView.setEGLConfigChooser(8, 8, 8, 8, 16, 0) + mView.holder.setFormat(PixelFormat.TRANSLUCENT) + mRenderer = MyRenderer() + mView.setRenderer(mRenderer) + mView.renderMode = GLSurfaceView.RENDERMODE_WHEN_DIRTY + } +} diff --git a/android/app/src/main/res/layout/activity_video_call.xml b/android/app/src/main/res/layout/activity_video_call.xml index a7470da3..a54e57b3 100644 --- a/android/app/src/main/res/layout/activity_video_call.xml +++ b/android/app/src/main/res/layout/activity_video_call.xml @@ -97,8 +97,7 @@ android:layout_alignParentTop="true" android:layout_alignParentEnd="true" android:layout_marginTop="@dimen/local_preview_margin_top" - android:layout_marginEnd="@dimen/local_preview_margin_top" - android:background="@color/localBackground"> + android:layout_marginEnd="@dimen/local_preview_margin_top"> + + Date: Thu, 17 Jun 2021 15:43:49 +0300 Subject: [PATCH 119/124] fix disconected stream --- .../kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 5b98b27d..d89c939c 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -371,6 +371,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId) mSession = null cmTimer.stop() + disconnectSession() } override fun onError(session: Session, opentokError: OpentokError) { @@ -477,11 +478,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mSession!!.subscribe(mSubscriber) } - override fun dismiss() { - videoCallResponseListener?.onCallFinished(1000) - super.dismiss() - } - private fun disconnectSession() { if (mSession == null) { videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED) @@ -489,6 +485,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session dialog?.dismiss() return } + if (mSubscriber != null) { mSubscriberViewContainer.removeView(mSubscriber!!.view) mSession!!.unsubscribe(mSubscriber) @@ -503,6 +500,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } mSession!!.disconnect() countDownTimer?.cancel() + videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) dialog?.dismiss() } From 02f43d6e61ed77836baa035df98f108b96d23431 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Jun 2021 16:08:03 +0300 Subject: [PATCH 120/124] fix timer issue --- .../kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt | 4 +++- .../profile/profile_screen/patient_profile_screen.dart | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index d89c939c..be1ed9d4 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -365,6 +365,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session cmTimer.base = SystemClock.elapsedRealtime() } cmTimer.start() + videoCallResponseListener?.minimizeVideoEvent(true) } override fun onDisconnected(session: Session) { @@ -372,6 +373,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mSession = null cmTimer.stop() disconnectSession() + videoCallResponseListener?.minimizeVideoEvent(false) } override fun onError(session: Session, opentokError: OpentokError) { @@ -581,7 +583,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session btnMinimize.setImageResource(res) setViewsVisibility() - videoCallResponseListener?.minimizeVideoEvent(!isFullScreen) +// videoCallResponseListener?.minimizeVideoEvent(!isFullScreen) } private fun setViewsVisibility() { diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index ea61359a..0a05b596 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -105,7 +105,7 @@ class _PatientProfileScreenState extends State StreamSubscription callTimer; callConnected(){ - callTimer = CountdownTimer(Duration(minutes: 1), Duration(seconds: 1)).listen(null) + callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) ..onDone(() { callTimer.cancel(); }) From c585cbb5be345162bb171e34bcd352f9f4c2c181 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Jun 2021 16:35:43 +0300 Subject: [PATCH 121/124] fix timer issue --- .../hmg/hmgDr/ui/fragment/VideoCallFragment.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index be1ed9d4..35e28b23 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -546,16 +546,27 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session 400, 600 ) - (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(false) } else { dialog?.window?.setLayout( 300, 300 ) - (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(true) } isCircle = !isCircle + if (mSubscriber != null) { + (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(isCircle) + } else { + if (isCircle) { + videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) + mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) + } else { + videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) + mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) + } + + } + if (isCircle) { controlPanel.visibility = View.GONE layoutMini.visibility = View.GONE From 61c94f85b271affbeb16ba41ec10b3c7ee5a1982 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 17 Jun 2021 16:47:31 +0300 Subject: [PATCH 122/124] fix the end call --- lib/core/service/VideoCallService.dart | 8 +-- .../viewModel/patient-referral-viewmodel.dart | 2 +- lib/models/patient/patiant_info_model.dart | 11 ++-- lib/screens/live_care/end_call_screen.dart | 11 +++- .../patient_profile_screen.dart | 56 ++---------------- lib/screens/procedures/ProcedureCard.dart | 59 +------------------ 6 files changed, 28 insertions(+), 119 deletions(-) diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 53739c9c..f72544a0 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//tartCallRes.openTokenID, - kSessionId: '1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg',//startCallRes.openSessionID, - kApiKey: '47247954',//'46209962', + kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", + kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg + kApiKey: '46209962',//'47247954' vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), @@ -80,7 +80,7 @@ class VideoCallService extends BaseService{ endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; - // await _liveCarePatientServices.endCall(endCallReq); + await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 9e852978..0351db77 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -240,7 +240,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: patient.appointmentNo, + admissionNo: int.parse(patient.admissionNo), referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 71d46dc9..29dc6198 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -224,10 +224,13 @@ class PatiantInformtion { isSigned: json['isSigned'], medicationOrders: json['medicationOrders'], nationality: json['nationality'] ?? json['NationalityNameN'], - patientMRN: json['patientMRN'] ?? json['PatientMRN']?? ( - json["PatientID"] != null ? - int.parse(json["PatientID"].toString()) - : int.parse(json["patientID"].toString())), + patientMRN: json['patientMRN'] ?? + json['PatientMRN'] ?? + (json["PatientID"] != null + ? int?.parse(json["PatientID"].toString()) + : json["patientID"] != null ? int?.parse( + json["patientID"].toString()) : json["patientId"] != null ? int + ?.parse(json["patientId"].toString()) : ''), visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index d355473d..d3db12b6 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -23,9 +23,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { + final PatiantInformtion patient; - - const EndCallScreen({Key key,}) : super(key: key); + const EndCallScreen({Key key, this.patient,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -42,11 +42,18 @@ class _EndCallScreenState extends State { String to; LiveCarePatientViewModel liveCareModel; + @override + void initState() { + super.initState(); + if(widget.patient!=null) + patient = widget.patient; + } @override void didChangeDependencies() { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; + if(routeArgs.containsKey('patient')) patient = routeArgs['patient']; } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index ea61359a..03def2f7 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -339,19 +339,18 @@ class _PatientProfileScreenState extends State if(isCallFinished) { - // Navigator.push(context, MaterialPageRoute( - // builder: (BuildContext context) => EndCallScreen(patient:patient))); - var asd = ""; + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => EndCallScreen(patient:patient))); } else { GifLoaderDialogUtils.showMyDialog(context); - // await model.startCall( isReCall : false, vCID: patient.vcId); + await model.startCall( isReCall : false, vCID: patient.vcId); if(model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(model.error); } else { await model.getDoctorProfile(); - // patient.appointmentNo = model.startCallRes.appointmentNo; + patient.appointmentNo = model.startCallRes.appointmentNo; patient.episodeNo = 0; GifLoaderDialogUtils.hideDialog(context); @@ -360,53 +359,6 @@ class _PatientProfileScreenState extends State }); - // await VideoChannel.openVideoCallScreen( - // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID, - // kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",// model.startCallRes.openSessionID, - // kApiKey: '47247954',//46209962 - // vcId: patient.vcId, - // patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), - // tokenID: await model.getToken(), - // generalId: GENERAL_ID, - // doctorId: model.doctorProfile.doctorID, - // onFailure: (String error) { - // DrAppToastMsg.showErrorToast(error); - // },onCallConnected: callConnected, - // onCallEnd: () { - // var asd=""; - // WidgetsBinding.instance.addPostFrameCallback((_) { - // GifLoaderDialogUtils.showMyDialog(context); - // model.endCall(patient.vcId, false,).then((value) { - // GifLoaderDialogUtils.hideDialog(context); - // if (model.state == ViewState.ErrorLocal) { - // DrAppToastMsg.showErrorToast(model.error); - // } - // setState(() { - // isCallFinished = true; - // }); - // }); - // }); - // Navigator.push(context, MaterialPageRoute( - // builder: (BuildContext context) => - // EndCallScreen(patient:patient))); - // }, - // onCallNotRespond: (SessionStatusModel sessionStatusModel) { - // var asd=""; - // // WidgetsBinding.instance.addPostFrameCallback((_) { - // // GifLoaderDialogUtils.showMyDialog(context); - // // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - // // GifLoaderDialogUtils.hideDialog(context); - // // if (model.state == ViewState.ErrorLocal) { - // // DrAppToastMsg.showErrorToast(model.error); - // // } - // // setState(() { - // // isCallFinished = true; - // // }); - // // }); - // // - // // }); - // }); - } } diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index d998ca58..31611b67 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -18,7 +18,7 @@ class ProcedureCard extends StatelessWidget { final int categoryID; final PatiantInformtion patient; final int doctorID; - + final bool isInpatient; const ProcedureCard({ Key key, this.onTap, @@ -26,7 +26,7 @@ class ProcedureCard extends StatelessWidget { this.categoryID, this.categoryName, this.patient, - this.doctorID, + this.doctorID, this.isInpatient = false, }) : super(key: key); @override @@ -132,36 +132,6 @@ class ProcedureCard extends StatelessWidget { ), ], ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).doctorName + ": ", - // //color: Colors.grey, - // fontSize: 12, - // color: Colors.grey, - // ), - // AppText( - // entityList.doctorName.toString(), - // fontSize: 12, - // bold: true, - // ), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).clinic + ": ", - // //color: Colors.grey, - // fontSize: 12, - // color: Colors.grey, - // ), - // AppText( - // entityList.clinicDescription ?? "", - // bold: true, - // fontSize: 12, - // ), - // ], - // ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -222,27 +192,6 @@ class ProcedureCard extends StatelessWidget { ), ], ), - /*Container( - alignment: Alignment.centerRight, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: entityList.procedureName, - patient: patient, - ), - ), - ); - }, - child: AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, - ), - ), - ),*/ Padding( padding: const EdgeInsets.all(8.0), child: Row( @@ -254,9 +203,7 @@ class ProcedureCard extends StatelessWidget { fontSize: 12, ), ), - if ((entityList.categoryID == 2 || - entityList.categoryID == 4) && - doctorID == entityList.doctorID) + if ((entityList.categoryID == 2 || entityList.categoryID == 4) && doctorID == entityList.doctorID && !isInpatient) InkWell( child: Icon(DoctorApp.edit), onTap: onTap, From 47dfde6e78c6a65ffc661fdfc64f3ab9baa5b6ec Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 20 Jun 2021 09:11:23 +0300 Subject: [PATCH 123/124] fix patient app bar --- lib/widgets/patients/profile/patient-profile-app-bar.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 4c411476..e6584a47 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -15,8 +15,8 @@ import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatientProfileAppBarModel patientProfileAppBarModel; - - PatientProfileAppBar({this.patientProfileAppBarModel}); + final bool isFromLabResult; + PatientProfileAppBar({this.patientProfileAppBarModel, this.isFromLabResult=false}); @override Widget build(BuildContext context) { From 7f6128b458c388983cb229021df4ddc4f067a0e9 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 20 Jun 2021 09:23:47 +0300 Subject: [PATCH 124/124] fix app bar issues --- lib/screens/live_care/end_call_screen.dart | 20 +++++++++++--------- lib/widgets/shared/app_scaffold_widget.dart | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 6fc67750..66a8270d 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -14,6 +14,7 @@ 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/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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'; @@ -204,19 +205,20 @@ class _EndCallScreenState extends State { .scaffoldBackgroundColor, isShowAppBar: true, appBar: PatientProfileAppBar( - patient, + patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient,isInpatient: isInpatient, + isDischargedPatient: isDischargedPatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + ), onPressed: (){ Navigator.pop(context); }, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient: isDischargedPatient), + ), body: Container( height: !isSearchAndOut ? isDischargedPatient diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index afcd8bd1..8f8a6e91 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -39,7 +39,7 @@ class AppScaffold extends StatelessWidget { this.isHomeIcon = true, this.subtitle, this.patientProfileAppBarModel, - this.drawer, this.extendBody = false, this.bottomNavigationBar}); + this.drawer, this.extendBody = false, this.bottomNavigationBar, this.appBar}); @override Widget build(BuildContext context) {